Root Props
| Prop | Type | Default |
|---|---|---|
className | string | — |
| Optional class name for the hidden element. Can be used to override or extend default visually hidden styles. | ||
asChild | boolean | — |
Renders the content using a child component instead of a native <div>. Useful for integrating into custom elements without extra wrappers. | ||
children | ReactNode | — |
| The content to be hidden visually but accessible via screen readers. Often used for labels, instructions, or announcements. | ||
ref | Ref<HTMLDivElement> | — |
| Ref to the visually hidden DOM element. Useful for focus management or measurement in accessible workflows. | ||
Child Parts
- None.
VisuallyHiddenis a single exported primitive.
Types
VisuallyHiddenProps
State Model
VisuallyHiddenhas no internal state.- Meaning changes only when the hidden content changes.