Pagination
A fully accessible pagination component for navigating through pages of content.
Usage
Preview
Examples
Basic
Preview
Custom Variant (Emphasis)
Preview
Few Pages
Preview
Many Pages
Preview
Custom Styling
Preview
Different Sizes
Preview
Non-Responsive
Preview
API
Pagination Structure
| Component | Description | Usage |
|---|---|---|
| Pagination | Main component that handles pagination logic and rendering | High-level component with built-in state management |
| PaginationRoot | Root container for pagination elements | Wraps all pagination components for custom implementations |
| PaginationContent | Container for page numbers and navigation buttons | Groups pagination items together |
| PaginationInfo | Displays information about items or total count | Shows contextual information like “Mostrando X itens” or “X total” |
| PaginationItem | Wrapper for individual pagination elements | Container for page numbers, ellipsis, or navigation buttons |
| PaginationLink | Clickable page number button | Interactive element for page navigation |
| PaginationPrevious | Previous page navigation button | Navigates to the previous page |
| PaginationNext | Next page navigation button | Navigates to the next page |
| PaginationEllipsis | Ellipsis indicator for hidden pages | Shows when there are hidden pages between visible ones |
Pagination
| Property | Type | Possible Values | Default | Description |
|---|---|---|---|---|
| currentPage | number | Any positive integer | - | The currently active page number. |
| totalPages | number | Any positive integer | - | The total number of pages available. |
| maxVisibleItems | number | Any positive integer | 2 (0 on mobile when responsive) | Maximum number of page numbers to show between ellipsis. |
| onPageChange | (page: number) => void | - | - | Callback function called when a page is selected. |
| itemsPerPage | number | Any positive integer | - | Number of items displayed per page (shown in PaginationInfo). |
| totalItems | number | Any positive integer | - | Total number of items across all pages (shown in PaginationInfo). |
| responsive | boolean | true, false | true | Enables responsive behavior that hides info and adjusts visible items on mobile. |
| size | ”sm” | “md” | “lg" | "sm”, “md”, “lg" | "md” | Size variant for all pagination buttons. |
| className | string | Any CSS class string | - | Additional CSS classes for styling customization. |
PaginationInfo
| Property | Type | Possible Values | Default | Description |
|---|---|---|---|---|
| count | number | Any positive integer | - | The number to be displayed. |
| label | string | Any string | ”itens” | The label text. When “itens”, shows “Mostrando X itens”. Otherwise shows “X label”. |
| className | string | Any CSS class string | - | Additional CSS classes for styling customization. |
PaginationLink
| Property | Type | Possible Values | Default | Description |
|---|---|---|---|---|
| isActive | boolean | true, false | false | Indicates if this page is the current active page. |
| variant | ”regular” | “emphasis” | “error” | “warning” | “outlined” | “success” | “regular-basic” | - | “regular” | Base visual variant. When active uses the variant; when inactive uses variant-soft (unless overridden by activeVariant/inactiveVariant). |
| activeVariant | ”regular” | “emphasis” | “error” | “warning” | “outlined” | “success” | “regular-basic” | - | - | Custom variant for the active state. Overrides the default variant behavior when isActive is true. |
| inactiveVariant | ”regular” | “emphasis” | “error” | “warning” | “outlined” | “success” | “regular-basic” | “regular-soft” | “emphasis-soft” | “error-soft” | “warning-soft” | “outlined-soft” | “success-soft” | “regular-basic-soft” | - | - | Custom variant for the inactive state. Overrides the default variant-soft behavior when isActive is false. |
| size | ”sm” | “md” | “lg" | "sm”, “md”, “lg" | "md” | Size of the page number button. |
| iconLeft | React.ReactNode | Any React node | - | Icon to display on the left side of the button. |
| iconRight | React.ReactNode | Any React node | - | Icon to display on the right side of the button. |
| className | string | Any CSS class string | - | Additional CSS classes for styling customization. |
PaginationPrevious / PaginationNext
| Property | Type | Possible Values | Default | Description |
|---|---|---|---|---|
| size | ”sm” | “md” | “lg" | "sm”, “md”, “lg" | "md” | Size of the navigation button. |
| disabled | boolean | true, false | false | Disables the button when there’s no previous/next page. |
| className | string | Any CSS class string | - | Additional CSS classes for styling customization. |
| children | React.ReactNode | Any React node | ”Anterior” / “Próximo” | Custom label for the button. |
PaginationEllipsis
| Property | Type | Possible Values | Default | Description |
|---|---|---|---|---|
| size | ”sm” | “md” | “lg" | "sm”, “md”, “lg" | "md” | Size of the ellipsis container to match button sizes. |
| className | string | Any CSS class string | - | Additional CSS classes for styling customization. |
Last updated on