Skip to content
Date & Time

Date Range Picker

Start/end date selection with presets.

Import

tsx
import { DateRangePicker } from "@cooud-ui/ui";
bash
npx cooud-ui add date-range-picker

Examples

API Reference

Generated from the component's exported types.

DateRangePickerProps

PropTypeDefaultDescription
value
DateRangeControlled value. Pair with `onValueChange`.
defaultValue
DateRangeInitial value for uncontrolled usage.
onValueChange
(range: DateRange | undefined) => voidCalled with the new range whenever the selection changes.
presets
DateRangePreset[]Optional shortcuts shown in a column beside the calendar.
placeholder
string"Pick a date range"Text shown on the trigger when no range is selected.
disabled
booleanfalseDisables the trigger entirely.
min
DateEarliest selectable day (inclusive).
max
DateLatest selectable day (inclusive).
disabledDates
Matcher | Matcher[]Extra non-selectable days, merged with `min`/`max`.
dateFormat
string"LLL dd, y"`date-fns` format token for each end of the range.
align
ComponentPropsWithoutRef<typeof PopoverContent>["align"]"start"Alignment of the popover against the trigger.
numberOfMonths
number2Number of months shown on wider viewports.
className
stringExtra classes for the trigger button.
contentClassName
stringExtra classes for the popover content.
aria-label
stringAccessible name for the trigger when there is no visible label.
aria-labelledby
stringID of an element labelling the trigger.