@adaptui/react
Version:
Collection of headless components/hooks that are accessible, composable, customizable from low level to build your own UI & Design System powered by Reakit
74 lines (73 loc) • 1.47 kB
TypeScript
export declare const usePaginationState: (props?: PaginationStateProps) => PaginationState;
export declare type PaginationState = {
/**
* The current active page
*/
currentPage: number;
/**
* All the page with start & end ellipsis
*/
pages: (string | number)[];
/**
* True, if the currentPage is at first page
*/
isAtFirstPage: boolean;
/**
* True, if the currentPage is at last page
*/
isAtLastPage: boolean;
/**
* Go to the specified page number
*/
movePage: (page: number) => void;
/**
* Go to next page
*/
nextPage: () => void;
/**
* Go to previous page
*/
prevPage: () => void;
/**
* Go to first page
*/
firstPage: () => void;
/**
* Go to last page
*/
lastPage: () => void;
};
export declare type PaginationStateProps = {
/**
* Set the default page(uncontrollable)
*
* @default 1
*/
defaultPage?: number;
/**
* Set the page(controllable)
*/
page?: number;
/**
*
*/
onChange?: (page: number) => void;
/**
* Total no. of pages
*
* @default 1
*/
count?: number;
/**
* No. of boundary pages to be visible
*
* @default 1
*/
boundaryCount?: number;
/**
* No. of sibiling pages allowed before/after the current page
*
* @default 1
*/
siblingCount?: number;
};