StartFoundationsComponentsContent

Date picker

A date picker is a form field for one date. People type the date or pick it from a calendar; the form gets an ISO date such as 2026-03-17.

Stable Figma
OverviewUsageAPIAccessibility
<tk-field label="Departure date" helper="For example, 27 3 2026">
  <tk-date-picker name="departure" min="2026-03-05" max="2026-09-30"></tk-date-picker>
</tk-field>

Put the date picker in a Field to give it a label, helper, and error. Without a Field, set aria-label. Inside a Field, set required and disabled on the Field.

Anatomy

Part What it is
tk-date-picker the element; two Tab stops
field part the bordered box; fills its container
input part the native text input; always typable
calendar button at the end of the box; opens the calendar; the second Tab stop
popover part the panel with the Calendar; opens below the box, or above near the bottom of the screen

The label, helper, and error come from a Field. The calendar is the same size at every field size.

Sizes

<tk-date-picker aria-label="Start date" value="2026-03-17"></tk-date-picker>
<tk-date-picker size="large" aria-label="End date" value="2026-03-24"></tk-date-picker>
size Height Padding-inline Value text
medium (default) 32px space-8 / space-4 Body Small (14/20)
large 36px space-10 / space-4 Body Medium (16/24)

The end padding is smaller so the 24px calendar button sits evenly in the box. The heights match Input and Button.

States

<tk-date-picker aria-label="Joined" value="2024-11-02" readonly></tk-date-picker>
<tk-date-picker aria-label="Renewal date" value="2026-11-02" disabled></tk-date-picker>
<tk-field label="Arrival date" error="Arrival date must be a real date">
  <tk-date-picker name="arrival"></tk-date-picker>
</tk-field>

The box doesn't change on hover. On focus, its border takes the focus color and grows thicker inward. While the calendar is open and focus is in it, the box shows no focus.

  • readonly: people can focus and copy the date; the calendar button doesn't work.
  • disabled: nothing works, and the date is left out of the form.
  • Error: set error on the Field. The border turns red and the message shows under the box.

Typing a date

The text is read when people press Enter or leave the field, never while they type. These all work:

  • 2026-03-27
  • 27 mar 2026, March 27, 2026, or 27 March (this year)
  • 27 3 2026, 27/3/2026, or 27.3.2026: day, month, year

Years need four digits. After a date is read, the field shows it as "27 Mar 2026".

If the text isn't a real date, the field keeps it, clears the value, and blocks the form from submitting. Show a message with the Field's error; see Content.

Opening the calendar

  • The calendar button, or Down in the field, opens the calendar. Focusing, clicking, or typing in the field never opens it.
  • Focus moves to the selected day, or today, or the first day people can pick.
  • Picking a day sets the value, closes the calendar, and returns focus to the field. There is no OK button.
  • Esc, a click outside, or Tab closes it without changing anything. Esc doesn't close a dialog around it.
  • People can click back into the field and type while the calendar stays open.

Memorable dates

For a date people know by heart, use Inputs, not a calendar:

<tk-field label="Day"><tk-input inputmode="numeric" autocomplete="bday-day"></tk-input></tk-field>
<tk-field label="Month"><tk-input inputmode="numeric" autocomplete="bday-month"></tk-input></tk-field>
<tk-field label="Year"><tk-input inputmode="numeric" autocomplete="bday-year"></tk-input></tk-field>
  • Use one field each for day, month, and year, under a group label such as "Date of birth" and one hint: "For example, 27 3 2007". Or use one field where space is tight.
  • Ask for the month as a number, not a select.
  • Don't move focus to the next field automatically.
  • Set autocomplete on birth dates: bday-day, bday-month, bday-year, or bday on one field.