feat(avatar): add default accessible labels to AvatarStatusDot per variant#4298
Open
gonzoblasco wants to merge 1 commit into
Open
feat(avatar): add default accessible labels to AvatarStatusDot per variant#4298gonzoblasco wants to merge 1 commit into
gonzoblasco wants to merge 1 commit into
Conversation
…riant
AvatarStatusDot now resolves a default accessible label per variant
("Online", "Away", "Busy") when no explicit `label` prop is given,
ensuring screen readers always have status meaning to announce
(WCAG 2.1 SC 1.4.1).
The label resolves as: explicit `label` prop → default per variant → none.
Custom augmented variants have no default label and continue to render
without role="img", as documented.
gonzoblasco
requested review from
cixzhang,
ejhammond and
imdreamrunner
as code owners
July 24, 2026 20:33
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #4157 — per @humbertovirtudes's suggestion (review comment), the default label piece from #4218 is now a separate PR against the shapes base that landed in #4157.
What this adds
AvatarStatusDot now resolves a default accessible label per variant when no explicit
labelprop is given, so screen readers always have status meaning to announce (WCAG 2.1 SC 1.4.1):success→ "Online"neutral→ "Away"error→ "Busy"Presence-oriented naming (rather than "Success"/"Neutral"/"Error") because the dot represents a person's real-time status.
Resolution order: explicit
labelprop → default per variant → none.Custom augmented variants (via
AvatarStatusDotVariantMapmodule augmentation) have no default label and continue to render withoutrole="img", as documented.Backward compatible: consumers who already pass an explicit
labelsee no change. The only behavioral difference is that dots without alabelprop now get one — which is the whole point.Tests: 4 new tests covering default labels per variant, explicit label override,
role="img"presence with default, and no role for custom variants without a default.