Summary
In streamdown 2.5.0 the built-in code-block controls (CodeBlockCopyButton, CodeBlockDownloadButton) expose their purpose only via the title attribute, and the copy-success feedback is purely visual (CopyIcon → CheckIcon swap for 2s).
Two gaps for assistive tech:
- No
aria-label on the buttons. title does work as an accessible-name fallback, but it's the weakest source (inconsistent SR support, no touch exposure) — an explicit aria-label mirroring the existing translations keys (copyCode, downloadFile) would be strictly better and is already localizable through the same prop.
- No live region for copy success. WCAG 2.1 SC 4.1.3 (Status Messages) wants the "Copied" state exposed without focus movement — e.g. a visually-hidden sibling
<span role="status"> whose text flips to translations.copied during the 2s success window. Today a screen-reader user gets no confirmation the copy happened.
Searched the dist: no aria-live/role="status" anywhere in the package.
Suggested fix
aria-label={translations.copyCode} (and per-button equivalents) on all control buttons.
- A sr-only
role="status" span in the actions wrapper announcing translations.copied while the success state is active.
Happy to PR either if there's interest.
Summary
In streamdown 2.5.0 the built-in code-block controls (
CodeBlockCopyButton,CodeBlockDownloadButton) expose their purpose only via thetitleattribute, and the copy-success feedback is purely visual (CopyIcon → CheckIcon swap for 2s).Two gaps for assistive tech:
aria-labelon the buttons.titledoes work as an accessible-name fallback, but it's the weakest source (inconsistent SR support, no touch exposure) — an explicitaria-labelmirroring the existingtranslationskeys (copyCode,downloadFile) would be strictly better and is already localizable through the same prop.<span role="status">whose text flips totranslations.copiedduring the 2s success window. Today a screen-reader user gets no confirmation the copy happened.Searched the dist: no
aria-live/role="status"anywhere in the package.Suggested fix
aria-label={translations.copyCode}(and per-button equivalents) on all control buttons.role="status"span in the actions wrapper announcingtranslations.copiedwhile the success state is active.Happy to PR either if there's interest.