Anatomy
Pagination consists of five sub-components:- Pagination: Root container that manages sizing context
- PaginationPrevious: Navigation button to go to the previous page
- PaginationNext: Navigation button to go to the next page
- PaginationContent: Container for page indicators
- PageIndicator: Button representing a specific page number
- PaginationEllipsis: Visual indicator for skipped page ranges
Basic Usage
Pagination
Root container that provides sizing context to all child components.Props
Controls the size of all pagination elements. Automatically propagates to child components.
Additional CSS classes to apply to the nav element.
Escape hatch for intentional structural overrides. Use with caution.
Example: Size Variants
PaginationPrevious
Navigation button that moves to the previous page.Props
Button size. Inherited from parent
Pagination unless explicitly overridden.Disables the button (typically when on the first page).
Handler called when the button is clicked.
Custom label text. Defaults to “Previous”.
Additional CSS classes.
Escape hatch for structural overrides.
Example: Custom Label
PaginationNext
Navigation button that moves to the next page.Props
Button size. Inherited from parent
Pagination unless explicitly overridden.Disables the button (typically when on the last page).
Handler called when the button is clicked.
Custom label text. Defaults to “Next”.
Additional CSS classes.
Escape hatch for structural overrides.
Example: Custom Label
PaginationContent
Container for page indicators and ellipsis elements.Props
Size inherited from parent
Pagination. Propagates to child PageIndicator and PaginationEllipsis components.Additional CSS classes.
Escape hatch for structural overrides.
PageIndicator
Clickable button representing a specific page number.Props
Marks this page as currently active. Applies active styling.
Button size. Inherited from parent components unless explicitly overridden.
Disables the button.
Handler called when the page indicator is clicked.
Page number or label to display.
Additional CSS classes.
Escape hatch for structural overrides.
Example: Active State
PaginationEllipsis
Non-interactive indicator showing that page numbers are being skipped.Props
Size inherited from parent components.
Additional CSS classes.
Escape hatch for structural overrides.
Example: Truncated Range
Navigation Patterns
Simple Pagination
Smart Truncation
Compact Pagination
Size Specifications
PageIndicator Sizes
- xs: 28px height/width
- s: 32px height/width
- m: 36px height/width (default)
- l: 40px height/width
Navigation Button Sizes
- xs: 28px height, 10px horizontal padding
- s: 32px height, 12px horizontal padding
- m: 36px height, 16px horizontal padding (default)
- l: 40px height, 16px horizontal padding
Accessibility
- Root element uses
<nav>withrole="navigation"andaria-label="pagination" - All buttons support keyboard navigation (Enter/Space)
- Disabled states prevent interaction and convey unavailability
- Active page indicator shows current location
- Focus indicators use design system focus rings
Data Attributes
Pagination
data-slot="pagination": Identifies the root containerdata-size: Current size variant
PageIndicator
data-slot="page-indicator": Identifies page indicator buttonsdata-active: Present whenisActive={true}data-size: Current size variant
Navigation Buttons
data-slot="pagination-previous": Identifies previous buttondata-slot="pagination-next": Identifies next buttondata-size: Current size variant
PaginationContent
data-slot="pagination-content": Identifies the content container
Source Reference
Implementation:packages/react/src/components/pagination.tsx