- Docs
- Components
- Type
Visually hidden
Content for screen readers only: read, never shown. Never display: none.
- Import
- @qeetrix/react
- Status
- StableSince 0.0.2
- Renders
<span>Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Import
// From the package: a build keeps only what it uses.
import { VisuallyHidden } from "@qeetrix/react";
// Or from its own path.
import { VisuallyHidden } from "@qeetrix/react/visually-hidden";02
Props
And every native attribute of the element it renders.
| Prop | Type | Default | What it does |
|---|---|---|---|
children | ReactNode | — | What's read. |
render | ReactElement | a <span> | Another element: a <div> around a block. |
03
Parts
Each part carries a data-slot, for tests and placement.
| data-slot | Element | What it is |
|---|---|---|
visually-hidden | <span> | Clipped to 1px. |
04
Not for focusable content
Something focusable shouldn't hide: a Skip link shows itself when focused.
<SkipLink />