Skip to content
Alea
Pro
  1. Alea
  2. Components
  3. Data entry
  4. MonthPicker

Data entry

MonthPicker

A grid of the 12 months of a year, with the year in the header: for a billing period, a report month or a card expiry. It moves like a calendar with the keyboard, and months outside the limits are shown but cannot be chosen.

import { MonthPicker } from '@alea-design/ui';

Examples

Billing month

Choose a month of a year: arrows and Home, End, Page Up and Page Down move like a calendar, and months outside the limits cannot be picked.

Tokens

The design tokens this component reads, with their value in the current theme. Override any of them to restyle it.

Color

  • --alea-chip-bg…
  • --alea-chip-text…
  • --alea-focus…
  • --alea-surface-hover…
  • --alea-text…
  • --alea-text-faint…
  • --alea-text-muted…

Space

  • --alea-space-1…
  • --alea-space-2…

Radius

  • --alea-radius-full…
  • --alea-radius-md…

Type

  • --alea-font-family-body…
  • --alea-font-size-md…
  • --alea-font-weight-regular…
  • --alea-font-weight-semibold…

Motion

  • --alea-motion-duration-fast…
  • --alea-motion-ease-standard…

Component

  • --alea-hit-min…

Props

MonthPicker props

A grid of the 12 months of a year with the year in the header: for a billing period, a report month, a card expiry. The keyboard moves like a calendar: arrows by month and by row, Home and End to the first and last month of the year, Page Up and Page Down by year. Months outside minValue and maxValue are shown but cannot be chosen. The names follow the language of the page.

PropTypeDefaultDescription
aria-labelstringnoneNames the picker for screen readers. Needed when it has no visible label.
classNamestringnoneExtra class names for the root element.
defaultValueYearMonth | nullnullThe month at first (uncontrolled).
defaultYearnumberthisThe year shown when nothing is chosen. Default: this year.
isDisabledbooleanfalse
maxValueYearMonthnoneThe latest month that can be chosen.
minValueYearMonthnoneThe earliest month that can be chosen.
onChange((value: YearMonth) => void)noneCalled when the value changes.
valueYearMonth | nullnoneThe chosen month (controlled). null for none.

Specs

Generated from the source: the variants in the types, the states and tokens in the CSS, and the motion patterns that apply. The grids render the real component in both themes; the numbers are measured from the page.

States
Hover (CSS)DisabledSelectedKeyboard focus
Dark and light
Every color comes from theme tokens, so it follows data-theme (and presets like Graphite) on the page or any wrapper. Contrast is checked in both themes.
Styling hooks
.alea-monthpicker.alea-monthpicker-head.alea-monthpicker-nav.alea-monthpicker-title.alea-monthpicker-grid.alea-monthpicker-row.alea-monthpicker-cell
Data attributes
data-density=touch

Accessibility

  • It is a grid of months: one tab stop, then the arrows move inside it, so it never adds 12 stops to the page.
  • Each month is named with its month and year ("May 2026") and says whether it is selected; months outside the limits are marked as disabled.
  • The year is a heading that is announced politely when it changes, and the two year buttons are named "Previous year" and "Next year".
  • The names of the months follow the language of the page, and in right-to-left languages the arrow keys and the year arrows swap sides.

Keyboard

KeyDoes
TabEnters and leaves the grid (one stop)
Arrow Left or RightPrevious or next month; at the edge of a year it changes the year
Arrow Up or DownThe same month one row up or down (four months)
Home or EndFirst or last month of the year
Page Up or Page DownThe same month in the previous or next year
Enter or SpaceChooses the focused month

Do and don't

Do

  • Give it an aria-label when there is no visible label next to it.
  • Set minValue and maxValue when the period has limits: the months stay visible but cannot be chosen.
  • Use it when the day does not matter; use DatePicker when it does.

Don't

  • Don't use it for a day or a range of days: that is DatePicker and RangeCalendar.
  • Don't hide months that cannot be chosen: people need to see why.

In Figma

The properties of the Figma components, generated from the kit, so they always match it. The last column is the React prop each one stands for.

Month picker · 2 variants

Figma propertyKindValuesDefaultReact prop
SelectedVariantMay, NoneMaydefaultValue
Tested with axe, keyboard and screen reader roles