Feature Library

Date picker: calendar, range and field

<0.01 CPU ms
A still of the Date picker: calendar, range and field demo
Still
The live demo starts when it’s in view.Pick a range on the calendar (the second end previews under the pointer) · type or open a field · arrows, Page Up/Down, Home/End, Enter, Esc

A date (and optional time) picker as an inline calendar or a popover from a text field, which becomes a bottom sheet on a phone.

What it costs a frame

<0.01 ms
GPU
not used
CPU, median
<0.01 ms
CPU, 95th pct
0.46 ms
Draw calls
0
Weight
Light

Measured 7 November 2026 on 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 156, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Measured with the demo driving itself, one step every 10 frames: it opens the Date field’s popover, moves the focus with the arrow keys and Page Up and Down (a month’s grid redrawn each time), closes it, then picks a range on the inline two-month calendar with the preview following the pointer across days, pages the months on and back, and types a date into a field. Nothing runs between steps. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
unknown GPU · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring toolnot timed<0.010.46
apple · Apple A19 Proin a browser tab · 16 November 2026not timed<0.012.10
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026not timed<0.011.17

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

What it needs

Renders with
DOM and CSSPlain DOM and CSS: every current browser.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages

What it’s for

  1. Dates in forms (a due date, a birthday, an appointment)
  2. Report and filter periods with presets
  3. Booking several days or a stay
  4. An appointment with a time in steps
  5. An always-visible calendar in a side panel

Pitfalls, in brief

  1. Values are plain { y, m, d } days (months from 1), not Date objects.
  2. The field shows text for people in the locale’s order (06/03/2026 is 6 March in en-GB and 3 June in en-US).
  3. "Today" is the browser’s day.
  4. Typing commits only a complete day with a four-digit year; two-digit years and a day without a year are read when the person leaves the field or presses Enter.
  5. Controlled use (value given): a pick calls onChange and changes nothing until you call setValue.
5 more in brief
  1. A range may span disabled days (a weekend inside a week off): check in onChange if your rules forbid that.
  2. The popover is position: fixed in document.body (or the input’s shadow root).
  3. The popover takes the field’s direction, lang, data-theme and the text size of the field’s parent when it opens.
  4. Week numbers are ISO 8601 (Monday weeks).
  5. Times are wall-clock hours and minutes with no zone.
10 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

Written for the library. Fully custom code.

WAI-ARIA Authoring Practices Guide (W3C): The date picker dialog example: the Choose Date button and its changing name, the modal dialog, the grid with its keys (arrows, Home/End, Page Up/Down and Shift for years), the month heading announced, and focus back on the opener. Also the spinbutton pattern for the time. Written here from scratch.

Howard Hinnant, chrono-compatible low-level date algorithms: The days-from-civil and civil-from-days method (400-year eras, years starting in March) behind toDays and fromDays, written here from its description.

ISO 8601: Week numbering (weeks start on Monday; week 1 holds the year’s first Thursday) and the YYYY-MM-DD text form.

Unicode CLDR week data: The first day of the week and weekend by region, as a fallback table where Intl.Locale has no week info.

date pickercalendardate rangetime pickerdatepicker dialoggridintllocaleweek numbersiso 8601bottom sheetpopoveraccessibilitykeyboardtouchrtldomcssno dependencies

Near it in the frame