Helper Utilities
Accessibility utilities for screen reader support in NuvoUI.
Screen Reader Only
The .sr-only
class visually hides content while keeping it accessible to screen readers. This is essential for providing context to users with assistive technologies.
How It Works
The .sr-only
utility applies specific styles to hide content visually while maintaining screen reader accessibility:
Usage Examples
Skip Navigation Links
Provide keyboard users a way to skip repetitive navigation:
Form Labels
When design uses placeholders instead of visible labels:
Icon Button Context
Provide text descriptions for icon-only buttons:
Current Page Indicators
In navigation menus, indicate the active page:
Status Announcements
Announce important status changes:
Best Practices
When to Use
- Navigation aids: Skip links, breadcrumb separators
- Form elements: Labels for inputs with only placeholders
- Icons and symbols: Text alternatives for visual indicators
- Status updates: Announce changes that are only visual
- Table headers: Additional context for complex tables
- Pagination: "Page X of Y" information
When NOT to Use
- Don't hide important content: If sighted users need it, don't hide it
- Don't duplicate visible text: Avoid redundancy
- Don't overuse: Too many screen reader announcements can be overwhelming
Implementation Guidelines
- Be concise but descriptive: "Close" is better than "X button"
- Provide context: "Delete item" is better than just "Delete"
- Test with real screen readers: NVDA, JAWS, VoiceOver
- Use semantic HTML first: Often better than hiding content
- Consider all users: What makes sense aurally and visually
Accessibility Testing
Tools
- Screen Readers: NVDA (free), JAWS, VoiceOver
- Browser Extensions: axe DevTools, WAVE
- Keyboard Navigation: Tab through your interface
- Automated Testing: Pa11y, Lighthouse
Quick Test
- Turn on a screen reader
- Close your eyes
- Navigate your interface
- Can you understand everything?
API Reference
Class | Description | CSS Properties |
---|---|---|
.sr-only | Screen reader only content | position: absolute , width: 1px , height: 1px , clip: rect(0,0,0,0) |
Browser & Screen Reader Support
Universal support across:
- All modern browsers: Chrome, Firefox, Safari, Edge
- All major screen readers:
- NVDA (Windows)
- JAWS (Windows)
- VoiceOver (macOS/iOS)
- TalkBack (Android)
- Narrator (Windows)
This pattern follows WCAG 2.1 Level AA guidelines for accessibility.