Overview
Component Library is built with accessibility as a core principle. All components follow WCAG 2.1 AA guidelines and include proper ARIA attributes.Key Features
ARIA Attributes
Proper ARIA labels, roles, and states
Keyboard Navigation
Full keyboard support for all interactive elements
Screen Readers
Optimized for screen reader compatibility
Color Contrast
WCAG AA compliant color contrast ratios
ARIA Attributes
Button Component
Input Component
Keyboard Navigation
Button
| Key | Action |
|---|---|
Enter | Activates button |
Space | Activates button |
Tab | Moves focus to button |
Input
| Key | Action |
|---|---|
Tab | Moves focus to input |
Shift + Tab | Moves focus to previous element |
| All typing keys | Enters text |
Focus Management
All components include visible focus indicators:Screen Reader Support
Semantic HTML
Components use semantic HTML elements:Hidden Text
Use thesr-only class for screen reader-only text:
Color Contrast
All components meet WCAG AA standards:- Normal text: 4.5:1 contrast ratio
- Large text: 3:1 contrast ratio
- Interactive elements: 3:1 contrast ratio
Testing Contrast
Form Accessibility
Labels
Always provide labels for inputs:Error Messages
Error messages are announced to screen readers:Required Fields
Indicate required fields visually and programmatically:Testing Accessibility
Automated Testing
Use Storybook’s accessibility addon:- Open Storybook
- Navigate to a component
- Check the “Accessibility” tab
- Review violations and warnings
Manual Testing
Keyboard Navigation
Keyboard Navigation
Screen Reader
Screen Reader
- Test with NVDA (Windows) or VoiceOver (Mac)
- Verify all content is announced
- Check form labels and errors
Color Contrast
Color Contrast
- Use browser DevTools
- Check contrast ratios
- Test in different color modes
Zoom
Zoom
- Test at 200% zoom
- Verify layout doesn’t break
- Check text remains readable
Best Practices
Always provide
aria-label for icon-only buttonsUse semantic HTML elements (button, input, label)
Ensure sufficient color contrast (4.5:1 for text)
Test with keyboard navigation
Provide visible focus indicators