Calendar
A month grid for picking dates; the building block of Date Picker.
- Picking one date in a form: use Date Picker.
Install
Terminal
pnpm dlx shadcn@latest add @acme/calendarOr import from the package: import { Calendar } from '@acme/react'
Examples
Picker basic
Invoice due date
Start date
date-picker-basic.tsx
'use client'
import { DatePicker } from '@/components/ui/date-picker'
// A fixed date keeps the example (and its screenshots) stable.
const today = new Date(2026, 9, 3)
export default function DatePickerBasic() {
return (
<div className="flex w-full max-w-xs flex-col gap-6">
<DatePicker label="Invoice due date" name="dueDate" defaultValue={new Date(2026, 9, 31)} />
<DatePicker
label="Start date"
placeholder="Choose a start date"
calendarProps={{ disabled: { before: today }, defaultMonth: today }}
/>
</div>
)
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| mode (required) | 'single' | 'multiple' | 'range' | — | Selection mode. |
| selected / onSelect | Date | Date[] | DateRange | — | Selection. |
| disabled | Matcher | — | Dates that cannot be picked, e.g. { before: new Date() }. |
Accessibility
| Key | Action |
|---|---|
| Arrow keys | Move by day / week |
| Page Up / Down | Previous / next month |
| Home / End | Start / end of week |
| Enter / Space | Selects the focused day |
- Role
- grid
- Built in
- Built on react-day-picker (WCAG 2.1 AA), styled with tokens.
- Today is marked by weight and underline, not color alone.
- WCAG 2.2 criteria
- 1.4.1, 2.1.1, 4.1.2
Tokens
- color.primary
- color.primary-foreground
- color.accent
- color.muted-foreground
- radius.md