Skip to content

feat(avatar): add default accessible labels to AvatarStatusDot per variant#4298

Open
gonzoblasco wants to merge 1 commit into
facebook:mainfrom
gonzoblasco:feat/avatar-status-dot-default-labels
Open

feat(avatar): add default accessible labels to AvatarStatusDot per variant#4298
gonzoblasco wants to merge 1 commit into
facebook:mainfrom
gonzoblasco:feat/avatar-status-dot-default-labels

Conversation

@gonzoblasco

Copy link
Copy Markdown

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 label prop 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 label prop → default per variant → none.

Custom augmented variants (via AvatarStatusDotVariantMap module augmentation) have no default label and continue to render without role="img", as documented.

Backward compatible: consumers who already pass an explicit label see no change. The only behavioral difference is that dots without a label prop 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.

…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.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 24, 2026
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jul 24, 2026 8:37pm

Request Review

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant