Code examples
Use semantic HTML
This semantic HTML contains all accessibility features by default.
Developer notes
Name
- Use
aria-label="Pagination"
when there is not a visible nav title.aria-describedby="title-id"
can be used when the nav title is a visible heading.
- Use
aria-label="Page X"
for each entry link.
Role
- Identifies itself as navigation
- Use
role="navigation"
when it’s not possible to use<nav>
. - DO NOT add menu or option roles with arrow key event listeners unless you’re building an actual application like Gmail.
State
- Use
aria-current="page"
on the current page item.