Skip to content

fix: improve accessibility for code block control buttons#560

Open
aradhyacp wants to merge 3 commits into
vercel:mainfrom
aradhyacp:feat/add-aria-sr-friendly-copy-download-code-blocks
Open

fix: improve accessibility for code block control buttons#560
aradhyacp wants to merge 3 commits into
vercel:mainfrom
aradhyacp:feat/add-aria-sr-friendly-copy-download-code-blocks

Conversation

@aradhyacp

Copy link
Copy Markdown
Contributor

Description

Improves accessibility for built-in code block controls by adding explicit accessible labels and screen reader feedback for copy actions.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Refactoring (no functional changes)

Related Issues

Fixes #556

Changes Made

  • Added aria-label to CodeBlockCopyButton and CodeBlockDownloadButton
  • Added a screen-reader-only status announcement for successful copy actions
  • Reused existing translation keys for localized accessibility labels and messages

Testing

  • All existing tests pass
  • Added new tests for the changes
  • Manually tested the changes

Test Coverage

Manually verified that:

  • Code block copy and download buttons expose accessible labels
  • Copy action announces success state to screen readers using a status region

Screenshots/Demos

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have created a changeset (pnpm changeset)

Changeset

  • I have created a changeset for these changes

Additional Notes

Added accessibility improvements without changing existing button behavior or UI appearance.

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@aradhyacp is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

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.

a11y: code-block control buttons are title-only — no aria-label, no copy-success live region

1 participant