Date Picker
Date Picker composes Button, Popover, and Calendar into an accessible single-date selection pattern.
Purpose
Date Picker is a composition of Button, Popover, and Calendar for selecting a single date in an application flow. Use Calendar alone when the calendar should remain visible.
Popover date picker
Installation
With the Siteplane registry alias configured, add the component and import the installed source from your app.
CLI
pnpm dlx shadcn@4.16.1 add @siteplane/date-pickerImport
import { Calendar } from "@/components/ui/calendar";
import { Popover, PopoverPopup, PopoverTrigger } from "@/components/ui/popover";
import { Button } from "@/components/ui/button";Need the machine-readable source metadata? View registry JSON.
Usage
Date Picker is a composition of Button, Popover and Calendar. There is no separate DatePicker primitive.
"use client";
import { useState } from "react";
import { CalendarIcon } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Calendar } from "@/components/ui/calendar";
import { Popover, PopoverPopup, PopoverTrigger } from "@/components/ui/popover";
export function Example() {
const [date, setDate] = useState<Date | undefined>();
return (
<Popover>
<PopoverTrigger render={<Button variant="outline" />}>
<CalendarIcon />
Pick date
</PopoverTrigger>
<PopoverPopup><Calendar mode="single" selected={date} onSelect={setDate} /></PopoverPopup>
</Popover>
);
}Examples
Field wiring, trigger formatting and disabled matchers are compositions of the same three primitives.
Single date picker
The trigger shows the short-formatted date and the popover closes after a selection.
Field integration
FieldLabel and FieldDescription connect to the trigger via aria-labelledby and aria-describedby.
With error
Formatted trigger
Disable past dates
Past days are blocked with the react-day-picker disabled matcher.
Booking date
Inline calendar
Skip the popover when the calendar can stay visible. The full primitive API lives in the Calendar docs.
API Reference
The reference lists the source-owned exports and props that are easy to miss in visual examples. Inherited Base UI props remain available unless the wrapper narrows them.
- Date Picker is a documented composition, not a separate primitive.
- Keep selected date and Popover open state in one clear controlled or uncontrolled owner.
- Pass date rules such as disabled dates to Calendar.
- Use
Fieldfor a visible label, description, invalid state, and error text. - Format the trigger label with the product locale while keeping the Date value as state.
Motion
Component motion uses the shared Siteplane motion contract. See the global motion guide for provider setup, tokens and reduced-motion behavior.
- Opening and closing uses native Popover motion; month navigation uses native Calendar motion.
- Do not wrap the composition in another height, opacity, or scale animation.
- Selected, disabled, and invalid states must not change the trigger dimensions.
Accessibility
- Give the trigger visible label context,
aria-label, oraria-labelledby. - Reflect invalid state on the trigger and render a visible
FieldError. - Keep keyboard navigation, Escape dismissal, outside click, and focus restoration native.
- The trigger text must communicate the selected date or a clear placeholder.
Implementation Guidance
- Compose canonical
PopoverPopup, Calendar, and Button; do not create a second Date Picker primitive. - Preserve native Calendar and Popover focus, dismissal, and motion.
- Use Field for form integration.