Skip to content

[React] Pagination component accessibility improvements #1404

@sawyerh

Description

@sawyerh

Mayflower version: 11.4.1

There are a number of potential accessibility improvements for the Mayflower Pagination component:

  1. It does not indicate to screen readers which page is currently selected, although there is visual styling to indicate this for sighted users. aria-current="true" could be set on the selected page number.
  2. <a> element is used for essentially a <button>. The elements could instead be changed to a <button> if this behavior is preserved, however it would also be useful for projects to be able to define the href of the <a> element so that it behaves like a link. This would allow projects to render the component as static HTML and preserve the active page number state in the page URL. For example:
    <Pagination pages={[ { active: false, text: "2", href: "/my-page?page=2" } ]} ...

More details about accessible pagination components: https://www.a11ymatters.com/pattern/pagination/

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions