goobs-frontend
Version:
A comprehensive React-based libary for building modern web applications
47 lines • 1.85 kB
TypeScript
import { default as React, FC, ReactNode } from 'react';
export interface PaginationProps {
page: number;
count: number;
onChange: (event: React.MouseEvent<HTMLButtonElement>, page: number) => void;
siblingCount?: number;
boundaryCount?: number;
hidePrevButton?: boolean;
hideNextButton?: boolean;
showFirstButton?: boolean;
showLastButton?: boolean;
/**
* Stable test selector — emitted as `data-pagination-field` on the
* <nav> root. Use when the page has multiple pagination instances (e.g.
* a contracts grid + a categories grid on the same workspace tab) so
* tests / the harvest can locate the right one without relying on
* positional traversal.
*/
dataField?: string;
/**
* ARIA label for the navigation landmark. Defaults to "pagination navigation".
* Override per-instance when several paginations live on the same page so
* screen reader users can disambiguate.
*/
ariaLabel?: string;
styles?: {
/** Disables every page/nav button. */
disabled?: boolean;
/** 'sacred' renders the gold palette; anything else keeps the default. */
theme?: string;
/** Gap between the button container's children (CSS length). */
gap?: string;
/** Padding on the root nav (CSS length; default 8px). */
padding?: string;
};
renderItem?: (item: PaginationRenderItemParams) => ReactNode;
}
export interface PaginationRenderItemParams {
page: number | null;
type: 'page' | 'first' | 'last' | 'next' | 'previous' | 'start-ellipsis' | 'end-ellipsis';
selected: boolean;
disabled: boolean;
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
}
declare const Pagination: FC<PaginationProps>;
export default Pagination;
//# sourceMappingURL=index.d.ts.map