StartFoundationsComponentsContent

Date range picker

A date range picker is a form field for a period, such as a stay or a report window. People type the start and end or pick them in a two-month calendar.

Stable Figma
OverviewUsageAPIAccessibility
<tk-date-range-picker label="Stay dates" helper="For example, 27 3 2026"
  start-name="check-in" end-name="check-out"
  min="2026-01-01" max="2026-12-31"></tk-date-range-picker>

The range picker brings its own label, helper, and error; don't put it in a Field.

Anatomy

Part What it is
tk-date-range-picker the element
label names the pair, such as "Stay dates"; an asterisk when required
helper optional hint under the label
field part the bordered box with both inputs
input part the start and end inputs, named "Start date" and "End date"; always typable
separator a "–" between the inputs
clear button "Clear dates"; shows when there is a value
calendar button opens the calendar
error the message under the box
popover part the panel with the presets and a two-month Calendar

Each date has its own input and its own name, so screen readers can tell start from end. Don't replace it with one "start – end" text field.

Sizes

<tk-date-range-picker label="Report period" size="large"
  start="2026-03-01" end="2026-03-31"></tk-date-range-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 calendar is the same size at every field size.

States

<tk-date-range-picker label="Billing period" disabled
  start="2026-02-01" end="2026-02-28"></tk-date-range-picker>
<tk-date-range-picker label="Trip dates" required
  error="Enter a start and end date"></tk-date-range-picker>

The box doesn't change on hover. Focus in either input colors the box's border and thickens it inward. An error keeps the border red, even with focus.

  • readonly: people can focus and copy the dates; the buttons don't work.
  • disabled: nothing works, and the dates are left out of the form.
  • error: your message, shown under the box. It replaces any message the picker writes itself.

Picking a range

  • The calendar button, or Down in either input, opens the calendar on the start date, or today.
  • The first pick sets the start and keeps the calendar open. Hovering shows the span.
  • The second pick sets the end, fires change, and closes the calendar.
  • A pick before the start moves the start.
  • Esc, a click outside, or Tab closes the calendar and drops a half-picked range. The previous range stays.
  • Each input can be typed in at any time, with the same formats as the Date picker. The text is read on Enter or when focus leaves the input.

Presets

Put buttons in the presets slot; they show to the left of the calendar. A button with data-start and data-end (ISO dates) selects that range and closes the calendar, with no script.

March 2026
<tk-date-range-picker label="Report period" start-name="from" end-name="to">
  <tk-button slot="presets" variant="ghost" size="small"
    data-start="2026-03-01" data-end="2026-03-31">March</tk-button>
  <tk-button slot="presets" variant="ghost" size="small"
    data-start="2026-01-01" data-end="2026-12-31">2026</tk-button>
</tk-date-range-picker>

Presets such as "Last 7 days" depend on today's date, so you write them: compute the dates in your code, or call selectRange().