Icon button with accessible label

<button type="button">
  ✕
  <VisuallyHidden>Close dialog</VisuallyHidden>
</button>

Skip navigation link

Skip to main contentSkip to main(Focus this area to reveal a skip link)
<a href="#main" class="skip-link">
  <VisuallyHidden>Skip to main content</VisuallyHidden>
</a>

Form field label supplement

<label>
  Search
  <VisuallyHidden> (press Enter to submit)</VisuallyHidden>
  <input type="search" />
</label>

Custom element

Visible text

This paragraph is visually hidden but accessible

More visible text
<VisuallyHidden component="p">
  This paragraph is hidden visually but accessible to screen readers
</VisuallyHidden>

Props

PropTypeDefaultDescription
componentstring'span'HTML element to render as root
classstringAdditional CSS class names
styleobjectInline styles
childrenReactNodeContent to hide visually but keep accessible