Visually Hidden
Content for assistive technology only. VisuallyHidden renders a native <span> clipped to a one-pixel box (the sr-only technique, never display: none). Screen readers read the content; sighted users never see it. The content also stays in copied and searched text.
When to use
- State context the visual design already carries: "(opens in a new tab)" on an external link, a caption on a layout table.
- Give a screen reader a text alternative for content it cannot read, such as a decorative chart.
- Style the message of a
LiveRegion, which builds on the same technique.
When not to use
- To name an icon-only control. Voice-control software skips a control whose only label is hidden DOM text, so use
aria-label, asIconButton's requiredlabelprop does. - To hide content from assistive technology too. Use the
hiddenattribute oraria-hidden. - For a link that appears on focus. Use
SkipToMainLink.
Read the status page (opens in a new tab) before you file an incident.
Polymorphism
VisuallyHidden accepts an asChild prop. When true, it renders its single child instead of its default <span>, forwarding its class names, data-* attributes, and ref onto that child. When the hidden content should be a more semantic element (a <caption>, a <legend>, a heading), reach for asChild.
| Region | Revenue |
|---|---|
| North America | $1,204 |
| Europe | $986 |
API Reference
VisuallyHidden
All props from span, plus: