Calendar
The month surface of every picker. React <Calendar> (packages/ui/src/components/Calendar.tsx) emits .dp-pop with presets, navigation .dp-nav, weekday row .dp-wd and the 6×7 grid .dp-grid of .dp-day cells. It is a plain surface without a popover, so it works inside Picker panel, inside a filter chip menu, in the rail and in the mobile sheet.
When to use
- The body of Date field (
mode="single",singleDatePresets), Date range (mode="range",months={2},pastRangePresets) and the task due panel. - A range picker embedded in a 264px menu:
mode="range"withmonths={1}— the.rangeframe is bound to the number of rendered months, not to the mode. - Any place a date is chosen by pointing rather than typing.
When not to use
- As the only entry path in a form — pair it with a typed field (Date field).
- A month overview of events — that is the Kalendář screen, not this picker.
- Selecting a time — Time field list.
Anatomy
.dp-pop: 264px, column, gap--sp-2;.dp-pop.range540px (two months, gap--sp-6).- Optional
headslot (range:.dp-entry.pair), then.dp-presetspills (26px,--radius-pill,--surface-75;.on= accent frame,--accent-ink, transparent) and.dp-rule. .dp-nav: height--control-h, arrows 26×26 quiet, titles.mtin--h3("srpen 2026",formatMonthYear)..dp-month252px:.dp-wdoverline weekday labels (locale first weekday),.dp-grid7×36px columns, cells.dp-day36×30,500 13px.- Cell states:
.weweekend--fg-secondary;.outother month--fg-muted;.todayaccent digit 600, no fill;.selfull--accenttile, white digit (selection carries the fill, AD 23 Jul 2026);.inbetween days--accent-tint/--accent-inkas a continuous band;.previewhalf-tint while the second end is hovered;:disabled(min/max)--ink-300. - Open range (one end only): the band runs off the grid on the open side and only the closed end gets the
.selstop (AD 29 Jul 2026). - Props:
months1 | 2 (mobile always 1),min,max,presets,today,locale,autoFocus,onRequestClose;onChange(value, commit).
Best practices
Do
- Use the exported presets (
singleDatePresets,pastRangePresets) and add your own only as{ label, get }in the same row. - Pass
todayin stories and tests so "today" and presets are stable. - Keep two months only in the 540px panel; in menus and on mobile show one.
Don't
- Filling "today" with accent — today is the accent digit, the fill belongs to the selection.
- Adding month/year selects to the nav — PageUp/PageDown and Shift for a year are the way to jump.
- Gaps or rounded corners between in-range cells; the band is continuous with radius only on row ends.
- A second calendar implementation (
react-datepicker,<input type="date">) anywhere.
Content
- Month title by
formatMonthYear("srpen 2026" — year always in this long form). - Cell
aria-labelbyformatDate(year only when needed); weekday labels fromIntlshort names. - Nav labels "Předchozí měsíc" / "Další měsíc"; presets sentence case ("Příští týden", "Posledních 7 dní").
Related
- date-field, date-range, date-time-range — the fields that open it.
- picker-panel — the floating container.
- filter-chip — chip menu that embeds a one-month range calendar.
Source: docs/date-time/calendar.usage.md · GitLab