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
| Prop | Type | Default | Description |
|---|---|---|---|
value | DateRange | — | Controlled value. Pair with `onValueChange`. |
defaultValue | DateRange | — | Initial value for uncontrolled usage. |
onValueChange | (range: DateRange | undefined) => void | — | Called 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 | boolean | false | Disables the trigger entirely. |
min | Date | — | Earliest selectable day (inclusive). |
max | Date | — | Latest 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 | number | 2 | Number of months shown on wider viewports. |
className | string | — | Extra classes for the trigger button. |
contentClassName | string | — | Extra classes for the popover content. |
aria-label | string | — | Accessible name for the trigger when there is no visible label. |
aria-labelledby | string | — | ID of an element labelling the trigger. |