- Components
- Date and time
Date Picker
DatePicker and DateRangePicker: a Select-like pill trigger that opens a Calendar in a popover. Surface-aware.
Installation#
npx shadcn add @ortaui/date-pickerExamples#
Single#
Range#
Disabled and invalid#
On a surface#
API reference#
| Prop | Type | Default | Description |
|---|---|---|---|
| surface | "default" | "raised" | auto | Look on a panel. Unset: raised (page fill + border) inside any [data-surface] container. "raised" forces it anywhere; "default" keeps the muted fill even inside a surface. |
| value / defaultValue | Date | DateRange | - | Controlled or uncontrolled. DateRange is { from?, to? } from react-day-picker. |
| onValueChange | (value) => void | - | Called when the selection changes. |
| format | (date: Date) => string | medium date | Formats the trigger label. |
| placeholder | string | - | Trigger text while empty. |
| name | string | - | Adds hidden ISO inputs (name, or name-from and name-to for a range). |
| calendarProps | CalendarProps | - | Forwarded to Calendar (disabled days, locale, caption). |
| numberOfMonths | number | 2 | DateRangePicker only. |