Components
Date picker
A date field that opens a calendar, with min, max and today shortcuts.
Free
pnpm dlx shadcn@latest add @caliper/date-pickerWhen to use
Use it for
- Due dates, birthdays and any single date in a form.
- You want typed and picked dates to agree.
Skip it when
- Two dates are needed; use a date range picker.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/date-picker
Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. No account needed. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage
This is the code behind the preview above.
example.tsx
import { useState, type ReactNode } from "react" import { DatePicker } from "@/components/ui/date-picker" import { formatISODate } from "@/components/ui/calendar" function Panel({ title, context, className = "max-w-md", children }: { title: string; context: string; className?: string; children: ReactNode }) { return ( <section className={`grid w-full gap-5 rounded-overlay border border-border bg-background p-6 shadow-resting ${className}`}> <div className="grid gap-1"> <p className="font-medium">{title}</p> <p className="text-sm text-muted-foreground">{context}</p> </div> {children} </section> ); } export function DueDate() { const [due, setDue] = useState<string | null>("2026-11-20"); return ( <Panel title="Invoice INV-0416" context="Northwind Traders · $4,820.00 · net 30" className="max-w-sm"> <DatePicker label="Due date" value={due} onValueChange={setDue} showToday /> <p role="status" className="text-sm text-muted-foreground">{due ? `Tomás Ferreira gets a reminder 3 days before ${formatISODate(due)}.` : "No reminder until a due date is set."}</p> </Panel> ); }
API reference
DatePicker
component
PropTypeDefault
label *string—
valuestring | null—
defaultValuestring | nullnull
onValueChange((value: string | null) => void)—
minstring—
maxstring—
showTodaybooleantrue
namestring—
disabledboolean—
classNamestring—
Accessibility
It is built on native elements and keeps aria-haspopup, aria-expanded, aria-hidden and aria-label in step with state.
KeyBehaviour
↑ / ↓ on the fieldOpens the calendar.
← / →Moves to the previous or next day.
↑ / ↓Moves to the same day in the previous or next week.
Home / EndMoves to the first or last day of the week.
PageUp / PageDownMoves to the same day in the previous or next month. With Shift, the previous or next year.
Enter / SpaceSelects the focused day.
EscapeCloses the calendar and returns focus to the field.
Motion
Transitions use the shared duration and easing tokens. Under prefers-reduced-motion those tokens collapse to instant and travel distances go to zero, so state changes still happen without movement.