Our pagination examples are wrapped in nav
elements, each with an aria-label=”Pagination”
. This helps distinguish the pagination from other nav
elements on the page.
An unordered list is used to list the pages, which allows screen readers to voice the number of elements in the Pagination component.
Each page link has an aria-label
including the word “page” along with the number. This helps orientate the user and clarify they are on a pagination button.
This component strives to follow WCAG 2.2 (level AA) guidelines, and care must be taken to ensure this effort is maintained when the component is implemented across other projects. This section offers advice to that effect:
nav
element to wrap the pagination, add role=”navigation”
to the wrapping element.aria-label
for any Pagination component’s nav
element that describes its purpose. For example, if the pagination component is used to navigate through a set of search results, an appropriate label could be aria-label="search results page"
.aria-label
value, then the screen reader will read out “Pagination navigation, navigation” . Use “Pagination” instead.aria-label
.aria-current=”page”
to the current page.