Calendar
A calendar component that allows users to select a date or a range of dates. Built on React DayPicker.
Default
Single date selection with captionLayout="dropdown".
Installation
CLI
Also needs
npx @sonojs/ui@latest add button popover && npm i date-fns lucide-react react-day-picker@^9.14.0Usage
calendar.tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| mode | "single" · "multiple" · "range" | - | Selection mode from React DayPicker. |
| captionLayout | "label" · "dropdown" · "dropdown-months" · "dropdown-years" | "label" | Month/year caption presentation. |
| buttonVariant | Button variant | "ghost" | Variant for previous/next nav buttons. |
| showOutsideDays | boolean | true | Show days from adjacent months. |