Skip to content
Mosaic
On this page

VisuallyHidden

Content exposed to assistive technology but not painted.

Use for

  • an accessible name for an icon-only button
  • a screen reader announcement, such as a live status message
  • text only screen readers should read

Practices

GuidancePractice
DoPass render={<div role='status' aria-live='polite' />} for an announcement.
DoPass render where a span is not valid in context.

API reference

VisuallyHidden

Renders a span, or the render element, and forwards its ref.

Slot: cl-visually-hidden

Examples

An icon-only button

TSX
<Button>
  <Icon glyph={Trash} />
  <VisuallyHidden>Delete</VisuallyHidden>
</Button>

A live message

TSX
<VisuallyHidden render={<div role='status' aria-live='polite' />}>{feedback}</VisuallyHidden>