Skip to content

Accessibility

Every AWC UI component is built with accessibility as a core requirement, not an afterthought. Components include:

  • WAI-ARIA roles and attributes applied automatically
  • Keyboard navigation following WAI-ARIA Authoring Practices
  • Focus management with visible focus indicators
  • Screen reader support via live regions and announcements

Components automatically apply the correct ARIA role:

ComponentRoleKey ARIA Attributes
md-buttonbuttonaria-disabled, aria-pressed (toggle), tabindex
md-checkboxcheckboxaria-checked, aria-disabled, aria-required
md-radioradioaria-checked, aria-disabled
md-switchswitcharia-checked, aria-disabled
md-dialogdialogaria-modal, aria-labelledby
md-menumenuaria-expanded, aria-haspopup
md-menu-itemmenuitemaria-disabled
md-tabtabaria-selected, aria-controls
md-tabstablistaria-orientation
md-sliderslideraria-valuenow, aria-valuemin, aria-valuemax
md-tooltiptooltiptrigger: aria-describedby
md-snackbaralertaria-live="polite"

All interactive components support keyboard operation:

ComponentKeysBehavior
ButtonEnter, SpaceActivate
CheckboxSpaceToggle checked state
RadioArrow Up/DownNavigate group
SwitchSpaceToggle on/off
MenuArrow Up/DownNavigate items
MenuEnter, SpaceSelect item
MenuEscapeClose
MenuHome/EndFirst/last item
TabsArrow Left/RightNavigate tabs
DialogEscapeClose (if dismissible)
DialogTabTrap focus within
SliderArrow Left/Right/Up/DownAdjust value
SelectArrow Up/DownNavigate options
SelectEnter, SpaceOpen/select
SelectEscapeClose dropdown

Every interactive component shows a visible focus ring when focused via keyboard (focus-visible):

:host(:focus-visible) {
outline: 3px solid var(--md-sys-color-secondary);
outline-offset: 2px;
}

AWC UI supports two disabled modes:

disabledsoft-disabled
Visual appearanceMuted (38% opacity)Muted (38% opacity)
FocusableNo (tabindex="-1")Yes (tabindex="0")
Click/tapBlockedBlocked
Screen readerAnnounces disabledAnnounces disabled
Use casePermanently unavailableDiscoverable but not actionable

Prefer soft-disabled when users should still be able to discover a control via keyboard navigation (e.g., a submit button that becomes enabled after filling required fields).

<!-- Removed from tab order entirely -->
<md-button disabled>Can't reach me</md-button>
<!-- Still in tab order, screen reader announces disabled -->
<md-button soft-disabled>Fill the form first</md-button>

Modal components (md-dialog, md-bottom-sheet) automatically trap focus within their boundaries when open, preventing users from tabbing to elements behind the modal.

  • Components use semantic HTML elements and ARIA attributes
  • State changes are announced via aria-live regions
  • Icon-only buttons should have aria-label:
<md-icon-button
icon="close"
aria-label="Close dialog"
></md-icon-button>

All MD3 token pairings meet WCAG 2.1 AA contrast requirements (4.5:1 for normal text, 3:1 for large text). The token system ensures on-* colors always contrast against their paired container color.

All components are tested for accessibility in unit tests:

describe('accessibility', () => {
it('has correct ARIA role', async () => {
const page = await create('<md-button>Click</md-button>');
expect(page.root?.getAttribute('role')).toBe('button');
});
it('sets aria-disabled when disabled', async () => {
const page = await create('<md-button disabled>Click</md-button>');
expect(page.root?.getAttribute('aria-disabled')).toBe('true');
});
it('is focusable via tabindex', async () => {
const page = await create('<md-button>Click</md-button>');
expect(page.root?.getAttribute('tabindex')).toBe('0');
});
});
  1. Always provide labels for icon-only buttons via aria-label
  2. Use soft-disabled instead of disabled when the action may become available
  3. Don’t remove focus indicators — they are required for keyboard accessibility
  4. Test with a screen reader — VoiceOver (macOS), NVDA/JAWS (Windows), TalkBack (Android)
  5. Use semantic structure — headings, landmarks, and lists around components
  6. Avoid tabindex > 0 — let the natural DOM order determine focus sequence