Foundation: Base UI
Craft UI leverages@base-ui/react as its foundation, which means every component comes with:
- Full keyboard navigation
- Proper ARIA attributes
- Screen reader support
- Focus management
- Semantic HTML structure
Keyboard Navigation
All interactive components support standard keyboard navigation patterns:Buttons and Links
Dialogs
Tooltips
Form Controls
ARIA Attributes
Craft UI components automatically include appropriate ARIA attributes:Dialog Component
The Dialog component uses proper ARIA roles and attributes:Checkbox Component
Button States
Buttons automatically handle loading and disabled states:Focus Management
Craft UI components handle focus properly in all scenarios:Focus Indicators
All interactive components have visible focus indicators:Focus Trapping
Modal components like Dialog automatically trap focus:1
Dialog Opens
Focus moves to the first focusable element inside the dialog.
2
Tab Navigation
Tab cycles through focusable elements within the dialog only.
3
Dialog Closes
Focus returns to the trigger element that opened the dialog.
Programmatic Focus
You can manually manage focus when needed:Screen Reader Support
Components provide meaningful information to screen readers:Semantic HTML
All components use semantic HTML elements:Labels and Descriptions
Always provide labels for form controls:Accessible Icon Buttons
When using icon-only buttons, provide accessible labels:Best Practices
Color Contrast
Text Alternatives
Always provide text alternatives for non-text content:Form Validation
Provide clear, accessible error messages:Loading States
Indicate loading states clearly:Responsive Design
Ensure components work at different zoom levels and viewport sizes:Testing Accessibility
Keyboard Testing
1
Tab Through Interface
Press Tab to navigate through all interactive elements. Ensure:
- All interactive elements are reachable
- Focus order is logical
- Focus indicators are visible
2
Test Keyboard Actions
- Buttons activate with Enter or Space
- Dialogs close with Escape
- Dropdowns open with Arrow keys
- Forms submit with Enter
3
Check Focus Trapping
In dialogs and modals:
- Focus stays within the modal
- Tab cycles through modal elements
- Focus returns to trigger on close
Screen Reader Testing
Test with popular screen readers:- NVDA (Windows, free)
- JAWS (Windows, commercial)
- VoiceOver (macOS/iOS, built-in)
- TalkBack (Android, built-in)
Each component in Craft UI is built on Base UI’s accessible primitives, which are thoroughly tested with screen readers.
Automated Testing
Use tools to catch common accessibility issues:Common Patterns
Accessible Form
Accessible Navigation
Resources
- WAI-ARIA Authoring Practices Guide
- Base UI Documentation
- WebAIM Contrast Checker
- WCAG 2.1 Guidelines
Next Steps
- Theming - Ensure your custom theme maintains accessibility
- Customization - Preserve accessibility when customizing components