Composition recipe
Compose Calendar and Popover for controlled dates, ranges, typed input, time, and natural language.
npx shadcn@4.19.0 add https://ui.edbn.me/r/button.json https://ui.edbn.me/r/calendar.json https://ui.edbn.me/r/popover.json https://ui.edbn.me/r/field.json https://ui.edbn.me/r/input.json https://ui.edbn.me/r/input-group.json https://ui.edbn.me/r/select.jsonnpm install date-fns react-day-picker chrono-nodePackages3
Date Picker is a Calendar rendered inside Popover. The trigger shows the formatted value, the feature owns the selected date, and Base UI manages popup focus and focus return.
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger render={<Button variant="outline" />}>
{date ? format(date, "PPP") : "Pick a date"}
</PopoverTrigger>
<PopoverContent className="w-auto p-0">
<Calendar mode="single" selected={date} onSelect={setDate} autoFocus />
</PopoverContent>
</Popover>Store Date | undefined for a single selection and DateRange | undefined for a range. Format only at the UI boundary; convert to the application’s transport format when saving.
See the underlying Calendar and Popover docs for their full interaction contracts.