Skip to content

fix(loader): add aria attributes for screen reader accessibility#46

Open
msmps wants to merge 3 commits intocloudflare:mainfrom
msmps:fix/loader-aria-accessibility
Open

fix(loader): add aria attributes for screen reader accessibility#46
msmps wants to merge 3 commits intocloudflare:mainfrom
msmps:fix/loader-aria-accessibility

Conversation

@msmps
Copy link
Contributor

@msmps msmps commented Feb 8, 2026

Description

  • Add role="status" and aria-label="Loading" to the Loader SVG component
  • Resolves WCAG 2.1 SC 4.1.3 (Status Messages - Level AA) violation

Problem

The Loader component renders an SVG spinner without any accessibility attributes, making it completely invisible to screen readers. When used as a loading indicator (e.g., in buttons, page transitions, async operations), assistive technology users receive no indication that content is loading.

Screen readers skip over the Loader entirely - users hear nothing.

Solution

Add two ARIA attributes to the SVG element:

  • role="status" - Indicates this is a live region for status updates
  • aria-label="Loading" - Provides the accessible name announced by screen readers

Screen readers announce "Loading, status" when the Loader is present.

Testing

Verified with VoiceOver on macOS:

  1. Enable VoiceOver (Cmd + F5)
  2. Navigate to a Loader component (Ctrl + Option + →)
  3. Confirm announcement: "Loading, status"

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 26, 2026

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

commit: 6103b33

@github-actions
Copy link
Contributor

Docs Preview

View docs preview

Commit: 6103b33

className={className}
style={{ height: sizeValue, width: sizeValue }}
role="status"
aria-label="Loading"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we make this a prop with a default value of "loading" so that we can ultimately pass a translated string down where we consume this?

@github-actions
Copy link
Contributor

Visual Regression Report

2 screenshot(s) with visual changes:

Loader / Default Size

34 px (0.01%) changed

Before After Diff
Before After Diff

Loader / Custom Size

40 px (0.01%) changed

Before After Diff
Before After Diff

Generated by Kumo Visual Regression

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.

2 participants