Jump to a page or a component.
Field-shaped trigger that opens the calendar in a popover. One Date in and out.
No install — ask an AI agent to copy this component from registry.json, then pnpm add react-day-picker.
import { DatePicker } from "@/components/ui/date-picker";${testId}-calendar for the calendar inside; its days and slots derive from that in turn.The props worth knowing. Everything else passes straight through to the underlying element, including className, which is merged last so it always wins.
| Prop | Type | Default | Description |
|---|---|---|---|
| value | Date | undefined | — | The picked moment. |
| onValueChange | (value: Date | undefined) => void | — | Next value; undefined when the day is deselected. |
| granularity | "date" | "time" | "datetime" | "date" | Passed to the calendar; also picks the glyph, placeholder and format. |
| placeholder | string | per granularity | Trigger copy with no value. Pass a translated string. |
| formatValue | (value: Date) => string | locale medium date / short time | Trigger copy from a value. |
| calendarProps | Calendar props | — | timeStart, timeEnd, timeStep, timeDisabled, disabled… for the calendar inside. |
| align | "start" | "center" | "end" | "start" | Popover alignment against the trigger. |