Skip to content

Visually Hidden

Overview

SrOnly removes content from the visual flow while keeping it accessible to assistive technologies. Uses the clip-rect technique recommended by WebAIM.

Usage

<button>
<svg aria-hidden="true">...</svg>
<span class="pm-sr-only">Close dialog</span>
</button>

Guidelines

  • Use for icon-only buttons that need accessible labels
  • Use focusable for skip navigation links
  • Do not use to hide decorative content (use aria-hidden instead)

API

PropTypeDefaultDescription
focusablebooleanfalseElement becomes visible when focused
asElementType"span"The HTML element to render