Aliases
date range picker
components / rangedatepicker
Two-month date-range field with start/end selection, blocked-date handling, and popover calendar containment.
Playground
Start here. Switch systems, interact with the shipped component, and let the rest of the page answer the why and how after the behavior clicks.
Cobalt
The crisp default DK action system: bright primary, roomy spacing, and a direct editorial rhythm.
Overview
This section explains the intent of the component before the implementation details.
Aliases
date range picker
Explore the math
Decision guide
Use these notes to decide quickly whether this is the right DK component for the job.
Decision guide
Do
Do not
Usage
Prefer these situations when choosing this component.
Usage
These patterns are better served by a different component or a simpler surface.
Anti-patterns
Migration notes
Anatomy
The anatomy explains which pieces matter to the recipe and accessibility model.
field button
triggerShows the current range summary and opens the two-month calendar.
calendar popover
surfaceContains the paired month grids and navigation controls.
calendar day
daySelectable day cell supporting start, end, and in-range styling.
API
The docs contract distinguishes props, DOM events, and slots so integration behavior is explicit.
Props
| Name | Type | Default | Description |
|---|---|---|---|
label | string | — | Visible label used for the field or control. |
description | string | — | Supporting helper copy rendered below or beside the main label. |
error | string | — | Validation or problem copy rendered in the error slot when present. |
placeholder | string | — | Placeholder text shown before a user makes a selection or enters text. |
required | boolean | false | Marks the field or control as required for form semantics and docs examples. |
disabled | boolean | false | Disables interaction and exposes the correct non-interactive semantics for the control. |
name | string | — | Form field name used for native form submission. |
id | string | — | Optional id used to bind external labels or descriptions to the component. |
size | 'sm' | 'md' | 'lg' | 'md' | Chooses the compiled size recipe for the component. |
value | { start?: string; end?: string } | — | Controlled ISO date-only range value. |
min | string | — | Earliest selectable ISO date. |
max | string | — | Latest selectable ISO date. |
disabledDates | string[] | — | Explicit ISO dates that cannot be selected. |
weekStartsOn | 0 | 1 | 0 | First day of the week for the month grid. |
open | boolean | false | Controlled popover open state. |
onOpenChange | (detail: { open: boolean }) => void | — | Callback fired when the calendar opens or closes. |
onChange | (detail: { value: { start?: string; end?: string } }) => void | — | Callback fired when the range changes. |
theme | ThemeContract | — | Overrides the compiled DK theme used to resolve tokens and recipes for this component. |
Events
| Name | Payload | Description |
|---|---|---|
openchange | { open: boolean } | Fires when an overlay-style component opens or closes through user interaction. |
change | { value: { start?: string; end?: string } } | Fires when the range changes. |
Slots
| Name | Description |
|---|---|
default | RangeDatePicker is prop-driven in v1 and does not expose custom day or panel slots. |
Recipes
These notes summarize the intended recipe surface rather than exposing raw implementation detail first.
Variants
Sizes
States
Accessibility
This is the behavior the component promises to assistive tech and keyboard users today.
Semantics
Keyboard
Screen readers
Checklist
Implementation
This section shows the representative compiled slot variables that the runtime consumes for the selected design system.
Implementation notes
Implementation checklist
Examples
Each example is intentionally practical, grouped by starter, common pattern, and edge-case coverage.
Starter
1 example
starter
Starter: booking windowA simple date-range field with DK labeling and helper copy.
Copy snippet
<RangeDatePicker label="Stay window" description="Choose the booking range." />Common patterns
1 example
common
Common: constrained rangeUse min, max, and blocked dates to keep the calendar honest.
Copy snippet
<RangeDatePicker label="Freeze window" min="2026-04-10" max="2026-04-20" disabledDates={['2026-04-16']} />Edge cases
1 example
edge
Edge: controlled range + popover stateControl the range and the surface when app workflow owns selection state.
Copy snippet
<RangeDatePicker value={range} open={isOpen} onOpenChange={(detail) => isOpen = detail.open} onChange={(detail) => range = detail.value} />Verification
Proofs stay visible in the docs so the system shows what it can guarantee, not just what it can render.
size=sm
size=md
size=lg