@payfit/unity-components
Version:
39 lines (38 loc) • 1.46 kB
TypeScript
import { ComponentPropsWithoutRef, ReactNode } from 'react';
export interface PaginationItemProps extends ComponentPropsWithoutRef<'li'> {
children: ReactNode;
/**
* The position of this item in the set (for aria-posinset)
* If not provided, will be calculated from context
*/
pageNumber?: number;
/**
* The total number of pages (for aria-setsize)
* If not provided, will be calculated from context
*/
pageCount?: number;
}
/**
* The PaginationItem component provides a list item wrapper for individual pagination controls.
* This component renders as a li element and should contain pagination links or buttons.
* It automatically gets pageCount from context and calculates aria attributes.
* @param props.children - The children to render.
* @param props.pageNumber - The position of this item in the set (for aria-posinset).
* @param props.pageCount - The total number of pages (for aria-setsize).
* @example
* ```tsx
* import { PaginationItem, RawPaginationLink } from '@payfit/unity-components'
*
* function MyPaginationItem() {
* return (
* <PaginationItem pageNumber={1}>
* <RawPaginationLink href="/page/1" isActive>
* 1
* </RawPaginationLink>
* </PaginationItem>
* )
* }
* ```
*/
declare const PaginationItem: import('react').ForwardRefExoticComponent<PaginationItemProps & import('react').RefAttributes<HTMLLIElement>>;
export { PaginationItem };