Skip to content
SENVENLI UI

Visually hidden

Text that screen readers read but the page does not show.
Rated 4 out of 5
Context for a screen reader
import { VisuallyHidden } from "@senvenli/react/display";

Guidelines

When to use it

  • A heading that names a region the layout already makes obvious.
  • Context an icon or a glyph gives sighted users.

Use something else when

  • A link to jump past the navigation. Skip link

Do and avoid

  • Never hide something a sighted user needs to read.

Accessibility

Built in

  • Hidden with the sr-only technique, so it stays in the accessibility tree.
  • isFocusable: shown while it has keyboard focus.

You provide

  • The words to read.

API reference

VisuallyHidden

childrenRequired
React.ReactNode
elementType
"div" | "span" | "label" | "h2" | "h3"Default "span"

span (default) inside a line, div for a block (a hidden heading that names a region).

isFocusable
boolean

Shown while it, or something in it, has keyboard focus: a skip link, a hidden "edit" action.

id
string