MonthPicker

Month field — combobox trigger with year navigation and month grid.

Preview

Live

<div class="ui-month">
  <button type="button" class="ui-month__trigger field-control" role="combobox"
    aria-haspopup="dialog" aria-expanded="false" aria-labelledby="month-label">
    <span class="ui-icon ui-icon--calendar ui-month__calendar" aria-hidden="true"></span>
    <span class="ui-month__value">Jun 2024</span>
    <span class="ui-icon ui-icon--chevron-down ui-month__chevron" aria-hidden="true"></span>
  </button>
</div>
<!-- Panel: .ui-month__panel[role=dialog] with yearbar + month cells -->

Variants

Empty

.is-empty placeholder state.

Invalid

.is-invalid validation state.

Accessibility

  • Trigger is a combobox; calendar/panel uses role="dialog" with panelLabel.
  • Wire a visible field label via aria-labelledby or aria-label.
  • Nav buttons need accessible names (prev* / next* labels).
  • Escape closes the panel and returns focus to the trigger (React MonthPicker).

API

HTML classes

Class Description
.ui-month / .is-open / .is-empty / .is-invalid Root states.
.ui-month__trigger / __value / __calendar / __chevron Combobox chrome.
.ui-month__panel / __yearbar / __year / __nav Month dialog.

React props

From src/core/MonthPicker.tsx — value is YYYY-MM.

Prop Type Default Description
value / onChange string / fn Controlled ISO-ish value (required).
placeholder string Empty display text (required).
panelLabel string Dialog accessible name (required).
disabled / invalid boolean false Disabled / invalid states.
aria-* string label, labelledby, describedby.
prevYearLabel / nextYearLabel string Year nav aria-labels (required).
monthLabels readonly string[] defaults Optional month name array.