Overview
We use a large block of connected links for our pagination, making links hard to miss and easily scalable—all while providing large hit areas. Pagination is built with list HTML elements so screen readers can announce the number of available links. Use a wrapping <nav>
element to identify it as a navigation section to screen readers and other assistive technologies.
In addition, as pages likely have more than one such navigation section, it’s advisable to provide a descriptive aria-label
for the<nav>
to reflect its purpose. For example, if the pagination component is used to navigate between a set of search results, an appropriate label could be aria-label="Search results pages"
.
Example
Use <Pagination>
and <Pagination.Item>
to wrap any custom paging items.
Disabled and active states
Use prop like active
and disabled
to set the states. Disabled links appear un-clickable and Active to indicate the current page.
Pagination Sizing
Use size
prop to set the size of all page items.
API
Pagination
import Pagination from `@trimbleinc/modus-react-bootstrap/Pagination`
Name | Type | Default | Description |
---|---|---|---|
size | 'sm' | 'lg' | Set's the size of all PageItems. | |
bsPrefix | string | 'pagination' |
PageItem
import PageItem from `@trimbleinc/modus-react-bootstrap/PageItem`
Name | Type | Default | Description |
---|---|---|---|
active | boolean | false | Styles PageItem as active, and renders a |
activeLabel | string | '(current)' | An accessible label indicating the active state.. |
disabled | boolean | false | Disables the PageItem |
href | string | ||
onClick | function | A callback function for when this component is clicked |