Calendar

The macOS graphical date picker: today in red, the chosen day on an accent circle.

@cupertinoui/calendarRegistry JSON

Installation

pnpm dlx shadcn@latest add @cupertinoui/calendar

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

import { Calendar } from "@/components/ui/calendar"

const [date, setDate] = React.useState<Date | undefined>(new Date())

<Calendar mode="single" selected={date} onSelect={setDate} />
Built on react-day-picker, so every DayPicker prop works: single, multiple or range mode, disabled days, several months and locales.

Examples

Date Picker

A pop-up button that opens the calendar in a popover.

Range

Two months and a range of days.

API Reference

Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.

Calendar

PropTypeDescription
mode"single" | "multiple" | "range"What can be chosen.
selected / onSelectThe chosen date(s).
buttonVariantButton variant
Default: "ghost"
The style of the month arrows.
classNamestringExtra classes, merged with the component's own.