You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: example/pages/accessibility.mdx
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,7 @@ You can also add an `aria-label` directly on the `<TypeAnimation />` component t
54
54
```tsx {2}
55
55
<TypeAnimation
56
56
aria-label="We produce food for Mice, Hamsters, Guinea Pigs and Chinchillas"
57
+
role="marquee"
57
58
sequence={[
58
59
// Same String at the start will only be typed once, initially
59
60
'We produce food for Mice',
@@ -70,6 +71,8 @@ You can also add an `aria-label` directly on the `<TypeAnimation />` component t
70
71
/>
71
72
```
72
73
74
+
Setting an `aria-label` requires setting a `role` as well. The role [`marquee`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/marquee_role) is probably the most suitable for this situation.
75
+
73
76
By applying an `aria-label`, the dynamically typed contents of your sequence will automatically be wrapped in a `<span/>` with `aria-hidden="true"` and removed from the accessibility tree:
0 commit comments