Installation
Add Component
Copy the code snippet below into you components folder.
Integrate Recipe
Integrate this recipe in to your Panda config.
Usage
Shortcuts
The Pagination component also provides a set of shortcuts for common use cases.
PaginationItems
This component renders the number of pages based on the count and pageSize props. Rendering this:
is shorthand for this:
Props
Root
| Prop | Default | Type | 
|---|---|---|
| defaultPage | 1 | numberThe initial active page when rendered. Use when you don't need to control the active page of the pagination. | 
| defaultPageSize | 10 | numberThe initial number of data items per page when rendered. Use when you don't need to control the page size of the pagination. | 
| siblingCount | 1 | numberNumber of pages to show beside active page | 
| type | \button\ | 'button' | 'link'The type of the trigger element | 
| asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. | |
| count | numberTotal number of data items | |
| ids | Partial<{
  root: string
  ellipsis: (index: number) => string
  prevTrigger: string
  nextTrigger: string
  item: (page: number) => string
}>The ids of the elements in the accordion. Useful for composition. | |
| onPageChange | (details: PageChangeDetails) => voidCalled when the page number is changed | |
| onPageSizeChange | (details: PageSizeChangeDetails) => voidCalled when the page size is changed | |
| page | numberThe controlled active page | |
| pageSize | numberThe controlled number of data items per page | |
| translations | IntlTranslationsSpecifies the localized strings that identifies the accessibility elements and their states | 
Ellipsis
| Prop | Default | Type | 
|---|---|---|
| index* | number | |
| asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. | 
Item
| Prop | Default | Type | 
|---|---|---|
| type* | 'page' | |
| value* | number | |
| asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. |