Screen readers
Utilities for improving accessibility with screen readers
Class reference
Usage
Use sr-only
to hide an element visually without hiding it from screen readers:
<a href="#">
<svg><!-- ... --></svg>
<span class="sr-only">Settings</span>
</a>
Use not-sr-only
to undo sr-only
, making an element visible to sighted users as well as screen readers. This can be useful when you want to visually hide something on small screens but show it on larger screens for example:
<a href="#">
<svg><!-- ... --></svg>
<span class="sr-only sm:not-sr-only">Settings</span>
</a>
By default, responsive
and focus
variants are generated for these utilities. You can use focus:not-sr-only
to make an element visually hidden by default but visible when the user tabs to it — useful for “skip to content” links:
<a href="#" class="sr-only focus:not-sr-only">
Skip to content
</a>
On this Page
v1.13.5