Skip to content

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/calendar

Or 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

Calendar props
PropTypeDefaultDescription
mode (required)'single' | 'multiple' | 'range'—Selection mode.
selected / onSelectDate | Date[] | DateRange—Selection.
disabledMatcher—Dates that cannot be picked, e.g. { before: new Date() }.

Accessibility

Keyboard
KeyAction
Arrow keysMove by day / week
Page Up / DownPrevious / next month
Home / EndStart / end of week
Enter / SpaceSelects 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