Skip to main content

Accessibility

Every Waria component is WCAG 2.1 AA compliant out of the box.

What You Get Automatically

FeatureDescription
ARIA attributesrole, aria-expanded, aria-controls, etc.
Keyboard navigationArrow keys, Tab, Enter, Space, Escape
Focus managementFocus trapping, focus restoration
Screen reader supportLive regions, announcements

Keyboard Shortcuts

Standard keyboard patterns across all components:

KeyAction
TabMove between focusable elements
Arrow KeysNavigate within a component
Enter / SpaceActivate buttons, select items
EscapeClose overlays, cancel
Home / EndJump to first/last item

Example: Dialog Accessibility

<w-dialog label="Confirm deletion">
<w-slot trigger><button>Delete</button></w-slot>
<w-slot body>
<div>Are you sure?</div>
</w-slot>
</w-dialog>

Waria automatically adds:

  • role="dialog" to the content
  • aria-modal="true" when modal
  • aria-label from the label prop
  • aria-labelledby if using a heading
  • Focus trap inside the dialog
  • Escape key handler
  • Focus restoration on close

Labels

Always provide accessible labels:

<!-- Using label prop -->
<w-dialog label="Settings">...</w-dialog>

<!-- Using aria-label -->
<w-nav aria-label="Main navigation">...</w-nav>

<!-- Using visible text (automatically detected) -->
<w-accordion>
<w-slot item name="faq">
<w-slot trigger><button>FAQ</button></w-slot>
<!-- "FAQ" becomes the accessible name -->
</w-slot>
</w-accordion>

Testing Accessibility

Recommended tools:

ToolPurpose
axe DevToolsBrowser extension for a11y audits
WAVEVisual accessibility checker
VoiceOver / NVDAScreen reader testing
Keyboard-onlyTest without a mouse

Standards

Waria follows: