DateRangePicker
Start/end date range with ISO strings and quick presets.
Design intent
Dashboards filter by rolling periods and custom date ranges. DateRangePicker provides an ISO contract and preset shortcuts while using the native date fields for keyboard and platform behavior.
npx @slipstream-ui/cli@latest add date-range-picker2026-01-01 to 2026-03-31
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | DateRange | — | Controlled range with ISO start/end strings. |
| defaultValue | DateRange | — | Initial range when uncontrolled. |
| onValueChange | (range: DateRange) => void | — | Fires with the next ISO range. |
| startLabel | string | 'From' | Accessible label for the start field. |
| endLabel | string | 'To' | Accessible label for the end field. |
| presets | DateRangePreset[] | — | Preset buttons. Defaults to 7/30/90 days and YTD. Windows compute against the browser-local today. |
| showPresets | boolean | true | Show the preset row. |
| disabled | boolean | — | Disable presets and both fields. |
Anti-patterns
validate_usage is the MCP tool that rejects these mistakes: the same list agents see over MCP and in the canonical markdown.
Don't use a single date field for a range
A range needs two independent ends. Use DateRangePicker so partial ranges and ordering are handled.
tsx// Avoid<DatePicker />
Accessibility
- Both native date inputs have visible associated labels.
- The end cannot precede the start; the range stays ordered.
Composition
Compose with FilterPanel: Place DateRangePicker inside a FilterPanel section
<FilterPanel sections={[{ title: 'Period', content: <DateRangePicker ... /> }]} />
Related components: DatePicker, FilterPanel, AppliedFilters
Dependencies
What the registry installs alongside this component. Package imports already include these.
npm packages
- class-variance-authority
- clsx
- tailwind-merge
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+: macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA, the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.