dgz-ui-shared
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library
39 lines • 1.54 kB
TypeScript
import { HTMLAttributes } from 'react';
/**
* Props for the MyPagination component.
*/
export interface MyPaginationProps extends HTMLAttributes<HTMLDivElement> {
/** The current 1-based page index. Defaults to 1. */
currentPage?: number;
/** Total number of pages. Defaults to 0. */
totalPages?: number;
/** Callback invoked with the new 1-based page number. */
onPageChange: (page: number) => void;
}
/**
* Renders a pagination control with page links and a "Go to page" selector.
*
* Notes
* - `currentPage` is 1-based. Defaults to 1 when not provided.
* - `totalPages` is the total number of pages. Defaults to 0 (no pages).
* - `onPageChange` is called with the 1-based page number whenever the user
* selects a page via the page links or the dropdown.
* - The component uses i18n for the "Go to page" label via `react-i18next`.
*
* @param className
* @param props - Component props
* @param props.currentPage - The current 1-based page index. Defaults to 1.
* @param props.totalPages - Total number of pages. Defaults to 0.
* @param props.onPageChange - Callback invoked with the new 1-based page number.
* @returns A pagination UI element.
* @example
* ```tsx
* <MyPagination
* currentPage={3}
* totalPages={10}
* onPageChange={(p) => console.log('go to', p)}
* />
* ```
*/
export declare const MyPagination: ({ currentPage, totalPages, onPageChange, className, ...props }: MyPaginationProps) => import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=MyPagination.d.ts.map