Pagination
Introduction
The Pagination component provides a navigation system for multi-page content with first, previous, next, and last page controls. It includes proper ARIA labels and keyboard navigation support.
When to use
- Blog post listings
- Search results
- Product catalogs
- Image galleries
- Data tables
- Any content split across multiple pages
Usage
Props
Prop | Type | Default | Description |
---|---|---|---|
firstPage | string | null | undefined | '#' | URL for the first page, falsy value disables the control |
previousPage | string | null | undefined | '#' | URL for the previous page, falsy value disables the control |
nextPage | string | null | undefined | '#' | URL for the next page, falsy value disables the control |
lastPage | string | null | undefined | '#' | URL for the last page, falsy value disables the control |
currentPage | string | number | '1' | Current page number |
totalPages | string | number | '12' | Total number of pages |
renderProgress | Function | undefined | Custom function to render the progress text |
Accessibility features
- Semantic
<nav>
element with properaria-label
- Clear visual indication of disabled controls
- Descriptive ARIA labels for navigation buttons
- Keyboard navigation support
- High contrast icons
- Clear focus indicators
- Proper button states