@hypothesis/frontend-shared
Version:
Shared components, styles and utilities for Hypothesis projects
19 lines (18 loc) • 705 B
TypeScript
export type PaginationProps = {
/** 1-indexed page number of currently-visible page of results */
currentPage: number;
/**
* Callback invoked when the user clicks a navigation button to change the
* current page.
*/
onChangePage: (page: number) => void;
/** The total number of available pages. */
totalPages: number;
};
/**
* Render controls for navigating between pages in a paginated list of items.
*
* Buttons corresponding to nearby pages are shown on wider screens; for narrow
* screens only Prev and Next buttons are shown.
*/
export default function Pagination({ currentPage, onChangePage, totalPages, }: PaginationProps): import("preact").JSX.Element;