Skip to content

Calendar ​

A month of days to choose one from, with the month and year opening grids of months and years.

Open in Storybook to try every prop.

When to use ​

  • On a page where the date is the main thing, e.g. choosing an interview day with that day's details beside it.
  • InputDate uses it in its popover; most forms should use InputDate.

When not to use ​

  • A date field in a form: use InputDate (people can type, and it's compact).
  • Dates far from today, like a date of birth: use InputDate; typing is quicker.

Anatomy ​

PartRequiredNotes
headingYes‹ previous, month ▾ and year ▾ buttons, › next.
day gridYesWeekday names, then 6 weeks of 32px days, starting Monday.
month / year grid—3 × 4 grids of 48px-tall cells, shown from the heading.

No frame: put it in a Card (or a popover, as InputDate does).

Properties ​

PropertyTypeDefaultDescription
modelValuestring (YYYY-MM-DD)—The chosen date.
min / maxstring (YYYY-MM-DD)—Days, months and years outside are greyed out.
localestringen-GBNames of days and months.
initialFocusbooleanfalseFocus the chosen day (or today) when it appears.
disabledbooleanfalse

States ​

StateAppearanceNotes
DayBlack text; days outside the month 35%.
HoveredBlack 10% fill.
ChosenPrimary fill, white text.
TodayBold, with a 4px dot underneath.Also on today's month and year.
Unavailable25% text.Outside min / max.
Focused2px focus ring.Keyboard only.

Behaviour ​

  • Arrow keys move between days, Page Up / Down between months; Enter or Space chooses.
  • Opens on the chosen date, else today, else the nearest allowed month.
  • Picking a month or year goes back to the days.

Accessibility ​

  • A grid of buttons with full dates as names; today is aria-current="date".

Platform adaptation ​

PlatformImplementationDifferences
Web / desktop (Vue)Calendar.vueReka UI Calendar.
iOS (SwiftUI)—DatePicker with .graphical style.
Android (Compose)—DatePicker (Material 3).

Tokens used ​

TokenUsed for
color-primaryChosen day, month, year
color-focusFocus ring

Released under the PolyForm Noncommercial License 1.0.0.