Skip to content

Keyboard Navigation

trud-calendar implements keyboard navigation following the WAI-ARIA grid pattern. Keyboard support is always enabled — no prop needed.

KeyAction
Arrow Left / Arrow RightMove focus between days
Arrow Up / Arrow DownMove focus between weeks
HomeFocus first day of the row
EndFocus last day of the row
Enter / SpaceOpen slot (create event)
TabMove to next focusable region
KeyAction
Arrow Left / Arrow RightMove focus between day columns
Arrow Up / Arrow DownMove focus between hour slots
HomeFocus first slot in the row
EndFocus last slot in the row
Enter / SpaceOpen slot (create event) or click focused event
TabMove between regions (toolbar → time grid → events)
KeyAction
Arrow Up / Arrow DownMove between event items
HomeFocus first event
EndFocus last event
Enter / SpaceClick focused event
KeyAction
Arrow Left / Arrow RightMove between view tabs
HomeFocus first tab
EndFocus last tab
KeyAction
EscapeClose the popover

The calendar uses the roving tabindex pattern. Only one cell in each grid has tabIndex={0} at a time — all others have tabIndex={-1}. This means:

  • Tab moves focus into the grid (lands on the active cell)
  • Arrow keys move focus within the grid
  • Tab again moves focus out of the grid

The calendar uses semantic ARIA roles:

  • Time grid hour slots: role="gridcell"
  • Agenda items: role="listitem" within role="list"
  • Toolbar view buttons: role="tab" within role="tablist"
  • Events: role="button" with keyboard activation

All focusable elements have visible focus indicators using focus-visible styles, ensuring keyboard users always know which element is focused. The focus ring uses the --trc-primary color variable.