Skip to content
Playground

Visually Hidden

Content hidden visually while remaining available to assistive technology.

Content hidden visually while remaining available to assistive technology.

TSX
import { VisuallyHidden } from "@zentara-co/zenos-ui";

Place a concise hidden label inside an icon-only button when visible text would be redundant. The button remains the interactive element; VisuallyHidden only contributes text to its accessible name.

Hidden text can clarify a visible count, symbol, or abbreviated status. Keep the primary information visible so all users receive the same result.

API gateway

status:

Healthy

Use an id with aria-labelledby when a control needs a persistent accessible name but the surrounding visual design cannot show one. A placeholder is not a label.

Search audit events

The visible placeholder is a hint; the hidden text supplies the persistent accessible name.

VisuallyHidden can carry a concise live-region announcement when the same outcome is also visible. Avoid announcing every intermediate update or duplicating text that another live region already reports.

Visible results: 0

No results added

Do not hide essential instructions, error recovery, or content useful to sighted users. VisuallyHidden always renders a clipped span; it is not suitable for skip links or any focusable control that must become visible on focus. Style the focusable element itself with a visually-hidden-until-focused pattern instead.

API

PropTypeDefaultDescription
children ReactNode — Content exposed to assistive technology.
id string — Allows another element to reference the hidden text as a label or description.
aria-live off | polite | assertive — Optionally announces changing hidden status text.
native props React.ComponentPropsWithoutRef<'span'> — Forwards native attributes, events, aria-*, data-*, className, style, and ref.

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

The content remains in the accessibility tree and normal DOM while occupying one clipped pixel visually. Test its result through the final accessible name or description rather than checking only that hidden text exists. Avoid repeating visible labels verbatim, and keep hidden copy synchronized when visible state changes.