Course contentsShow
← Web Development
Lesson 933 of 2,98216. Forms and ValidationFree lesson

Date and Time Picker Accessibility

Implementing keyboard-navigable date pickers with grid patterns and screen reader announcements.

Date and Time Picker Accessibility

What you'll learn: How to build keyboard-navigable date pickers that work seamlessly with screen readers using proper grid patterns and ARIA announcements.

Why Date Pickers Need Special Care

Date pickers are complex widgets that combine navigation, selection, and context (months, years, dates). Unlike standard inputs, they present a visual calendar grid that sighted users navigate with a mouse. For keyboard and screen reader users, you must provide equivalent experiences through proper structure and announcements.

The Calendar Grid Pattern

Think of a calendar like a spreadsheet: rows represent weeks, columns represent days. This translates perfectly to the ARIA grid role:

<div role="dialog" aria-modal="true" aria-labelledby="dialog-title">
  <h2 id="dialog-title">Choose a date</h2>
  <div role="grid" aria-labelledby="month-label">
    <div id="month-label">March 2024</div>
    <div role="row">
      <span role="columnheader">Sun</span>
      <span role="columnheader">Mon</span>
      <!-- ... -->
    </div>
    <div role="row">
      <button role="gridcell" tabindex="-1" aria-label="March 1, 2024">1</button>
      <button role="gridcell" tabindex="-1" aria-label="March 2, 2024">2</button>
      <!-- ... -->
    </div>
  </div>
</div>

Keyboard Navigation

Implement arrow key navigation where:

  • Arrow keys move between dates (not Tab)
  • Tab moves between major sections (month/year selectors, grid, action buttons)
  • Enter/Space selects the focused date
  • Use tabindex="-1" on all cells except the currently focused one

Screen Reader Announcements

Use aria-label on each date button to announce "March 15, 2024" instead of just "15". When users navigate, update a live region or the selected cell's aria-selected="true" state so screen readers announce what changed.

Key Takeaway: Accessible date pickers use the ARIA grid pattern with arrow-key navigation, meaningful labels on each date, and proper role/state announcements to create an equivalent experience for all users.