Skip to content

Commit cd0fcce

Browse files
committed
[WB-2173_dismiss-described-by] update a11y docs
1 parent 9d101d5 commit cd0fcce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

__docs__/wonder-blocks-card/accessibility.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ When using semantic tags like `tag="section"` or `tag="figure"`, you should prov
2424

2525
Only one labeling mechanism can be used at a time. Refer to the [Accessible Name Computation specification](https://www.w3.org/TR/accname-1.2/#computation-steps) to understand how this is standardized.
2626

27-
When the `onDismiss` prop is provided, a dismiss button will be rendered. In this case, the `labels.dismissButtonAriaLabel` prop is required to provide a translatable, accessible label for the dismiss button.
27+
When the `onDismiss` prop is provided, a dismiss button will be rendered. In this case, the `labels.dismissButtonAriaLabel` prop is required to provide a translatable, accessible label for the dismiss button. `labels.dismissButtonAriaDescribedBy` is also available as an optional argument to provide supplemental context.
2828

2929
## Dismiss Button
3030

3131
When `onDismiss` is provided, an accessible dismiss button is automatically added:
3232

3333
- The button has `aria-label` set from `labels.dismissButtonAriaLabel`
34+
- The button has `aria-describedby` set from the optional `labels.dismissButtonAriaDescribedBy`
35+
- Use `labels.dismissButtonAriaDescribedBy` only when `labels.dismissButtonAriaLabel` alone does not provide sufficient context within a reasonable string length. For example, when there are multiple similar cards on the same page whose distinctions become clear only via the body content of the Card.
3436
- The button is positioned in the top-right corner of the card (with support for RTL languages)
3537
- Focus management should be handled by the consuming application when the card is dismissed
3638

0 commit comments

Comments
 (0)