Skip to content

fix(pagination): add aria attributes for screen reader accessibility#47

Open
msmps wants to merge 2 commits intocloudflare:mainfrom
msmps:fix/pagination-aria-navigation
Open

fix(pagination): add aria attributes for screen reader accessibility#47
msmps wants to merge 2 commits intocloudflare:mainfrom
msmps:fix/pagination-aria-navigation

Conversation

@msmps
Copy link
Contributor

@msmps msmps commented Feb 8, 2026

Description

  • Wrap pagination controls in <nav aria-label="Pagination">
  • Add role="status" and aria-live="polite" to "Showing X-Y of Z" text for page change announcements
  • Resolves WCAG 2.1 SC 1.3.1 (Info and Relationships) and SC 4.1.3 (Status Messages) violations

Problem

  1. Controls were wrapped in a generic <div>
  2. The "Showing X-Y of Z" status text wasn't announced when pages changed

Solution

Add semantic HTML and ARIA attributes:

  • <nav aria-label="Pagination">
  • role="status" - Identifies the "Showing X-Y of Z" text as a status region
  • aria-live="polite" - Announces page range changes without interrupting user

Testing

Verified with VoiceOver on macOS:

  1. Enable VoiceOver (Cmd + F5)
  2. Use rotor (Ctrl + Option + U) to open landmarks menu
  3. Confirm "Pagination, navigation" appears in the list
  4. Navigate between pages and confirm "Showing X-Y of Z" is announced

Question: Are we aligned on using <nav> over <div role="navigation">?

@msmps msmps changed the title fix(pagination): add ARIA attributes for screen reader accessibility fix(pagination): add aria attributes for screen reader accessibility Feb 8, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 26, 2026

npm i https://pkg.pr.new/@cloudflare/kumo@47

commit: 6a06ca0

@mattrothenberg
Copy link
Collaborator

@msmps small merge conflict in this one FYI

@github-actions
Copy link
Contributor

Docs Preview

View docs preview

Commit: 6a06ca0

@github-actions
Copy link
Contributor

Visual Regression Report

9 screenshot(s) with visual changes:

Button / Variants

Before After
Before After

Button / Loading State

Before After
Before After

Dialog / Basic Dialog

Before After
Before After

Dialog / Confirmation Dialog (Alert)

Before After
Before After

Dialog / With Actions

Before After
Before After

Dialog (Open)

Before After
Before After

Select / Select

Before After
Before After

Select / Select.Option

Before After
Before After

Select (Open)

Before After
Before After
4 screenshot(s) unchanged
  • Button / Sizes
  • Button / With Icon
  • Button / Icon Only
  • Button / Disabled State

Generated by Kumo Visual Regression

Copy link
Collaborator

@geoquant geoquant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// instead of:
<div role="status" aria-live="polite" className="...">

// use:
<div aria-live="polite" aria-atomic="true" className="...">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants