Skip to content

Date picker ​

Lets people type a date, or a date and time, or pick it from a calendar.

base-basedatepicker--openOpen in Storybook ↗

When to use ​

  • Every date field in forms and inline editors: Date of birth, Publication date.
  • A moment that needs a time as well: use the date and time variant.

When not to use ​

  • A year on its own, or a number of days: use a number text input.
  • A vague or partial date such as around 1900: use a text input.

Anatomy ​

  1. Field: the same border, --radius-input corners, --text-input size and --control-height as a text input, with the border one step darker on hover (--color-input-border-hover). It shows the date as dd/mm/yyyy.
  2. Calendar icon: at the start of the field, in --color-text-secondary.
  3. Clear button: a ✕ at the end of the field when it has a value.
  4. Calendar: opens under the field. A header with previous and next month buttons, and the month and year, which open a list of months or years when clicked.
  5. Day grid: seven columns, starting on Monday. Days of the next and previous month are greyed out. Today has a thin ring and the chosen day is filled, both in --color-commit.
  6. Time (date and time only): a clock button under the grid opens hours and minutes.

Variants ​

VariantShowsFormat
Datea calendardd/mm/yyyy
Date and timea calendar with a clock button for the timedd/mm/yyyy hh:mm, in the viewer's time zone

States ​

StateWhat you seeTrigger
Emptycalendar icon and the placeholder Select dateno value
Filledthe formatted date and a ✕a value
Hoverborder one step darkerpointer
Focusfocus ring around the fieldclick or Tab
Opencalendar under the field, on the month of the valueclick, or typing in the field
Disabledgrey fill; the calendar does not openthe field is unavailable
base-basedatepicker--statesOpen in Storybook ↗

Picking a day fills the field and closes the calendar straight away. Typing works as well: Enter, Tab or leaving the field takes the typed date. Text that isn't a valid date doesn't change the value.

Picking only changes the field. The form or inline editor around it saves the change.

Keyboard & accessibility ​

KeyIn the fieldIn the calendar
Typingopens the calendar and enters the date—
Entertakes the typed datepicks the focused day, or presses the focused button
Space—picks the focused day
Tabtakes the typed date and moves onmoves through the header buttons, then the days
Escapecloses the calendarcloses the calendar
  • The calendar is a role="dialog"; the days are a role="grid" and the chosen day has aria-selected="true".
  • The header buttons are named Previous month, Next month, Open months overlay and Open years overlay; the clock button is Open time picker, and the ✕ is Clear value.

Content ​

  • Labels are nouns: Date of birth, Publication date.
  • Write dates as dd/mm/yyyy, and times on the 24-hour clock: 18/08/2026 14:30.
  • The placeholder is Select date.

Text input · Dropdown · Content · Accessibility

Powered by Elody - Open Source Semantic Data Platform