Screen readers, such as iOS VoiceOver, are essential tools for users with visual impairments, providing auditory feedback and allowing them to interact with digital content.

What is iOS VoiceOver?

VoiceOver is Apple’s built-in screen reader for iPhones and iPads. It reads on-screen elements aloud, allowing users to navigate using gestures and auditory feedback. Users can enable VoiceOver in Settings > Accessibility > VoiceOver or via Siri by saying, “Turn on VoiceOver.”

Using sr-only for Hidden from everyone but Screen Readers

Sometimes, you may want to hide a label to maintain a clean design while still ensuring that screen readers can interpret the label correctly for users who rely on them.

In this example, you have a form with a text area for submitting comments. You want to hide the label “Comment” from the visual layout while still making it available to screen readers.

Here’s an example where a label is hidden visually but still accessible to screen readers, using Tailwind CSS’s sr-only class.

<InputLabel for="body" class="sr-only">Comment</InputLabel>
<TextArea id="body" v-model="commentForm.body" rows="4" placeholder="Speak your mind Spock…"/>

This approach maintains a clean, minimal design while ensuring that screen reader users can understand the purpose of the input field. It’s a great solution for creating accessible and visually appealing forms without compromising usability.