@porsche-design-system/components-react
Version:
Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.
65 lines (64 loc) • 2.92 kB
TypeScript
import type { BaseProps } from '../../BaseProps';
import type { PaginationInternationalization, PaginationUpdateEventDetail } from '../types';
export type PPaginationProps = BaseProps & {
/**
* Sets the one-based index of the currently active page; update this prop to navigate programmatically.
* @default 1
*/
activePage: number;
/**
* Overrides the default ARIA label strings used for the previous, next, and page number buttons to support localisation.
* @default { root: 'Pagination', prev: 'Previous page', next: 'Next page', page: 'Page', }
*/
intl?: PaginationInternationalization;
/**
* Sets the number of items displayed per page, used together with `totalItemsCount` to compute the page count.
* @default 1
*/
itemsPerPage?: number;
/**
* Emitted when the user navigates to a different page, carrying the new `activePage` index in the event detail.
*/
onUpdate?: (event: CustomEvent<PaginationUpdateEventDetail>) => void;
/**
* Shows or hides the button that jumps directly to the last page of the pagination.
* @default true
*/
showLastPage?: boolean;
/**
* Sets the total number of items in the dataset, used to calculate the number of pages.
* @default 1
*/
totalItemsCount: number;
};
export declare const PPagination: import("react").ForwardRefExoticComponent<Omit<import("react").DOMAttributes<{}>, "onChange" | "onInput" | "onToggle"> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "inputMode" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
/**
* Sets the one-based index of the currently active page; update this prop to navigate programmatically.
* @default 1
*/
activePage: number;
/**
* Overrides the default ARIA label strings used for the previous, next, and page number buttons to support localisation.
* @default { root: 'Pagination', prev: 'Previous page', next: 'Next page', page: 'Page', }
*/
intl?: PaginationInternationalization;
/**
* Sets the number of items displayed per page, used together with `totalItemsCount` to compute the page count.
* @default 1
*/
itemsPerPage?: number;
/**
* Emitted when the user navigates to a different page, carrying the new `activePage` index in the event detail.
*/
onUpdate?: (event: CustomEvent<PaginationUpdateEventDetail>) => void;
/**
* Shows or hides the button that jumps directly to the last page of the pagination.
* @default true
*/
showLastPage?: boolean;
/**
* Sets the total number of items in the dataset, used to calculate the number of pages.
* @default 1
*/
totalItemsCount: number;
} & import("react").RefAttributes<HTMLElement>>;