ComponentsForm
Calendar
A calendar component wrapping react-day-picker with Visor token styling and Phosphor icon navigation.
Single Selection
May 2026
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
Range Selection
May 2026
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
Multiple Selection
May 2026
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
With Disabled Dates
May 2026
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
Installation
npx visor add calendarThis copies two files into your project:
components/ui/calendar/calendar.tsx— the componentcomponents/ui/calendar/calendar.module.css— the styles
Usage
import { Calendar } from '@/components/ui/calendar/calendar';
import { useState } from 'react';
export default function Example() {
const [date, setDate] = useState<Date | undefined>(new Date());
return (
<Calendar
mode="single"
selected={date}
onSelect={setDate}
/>
);
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
mode | 'single' | 'multiple' | 'range' | — | Selection mode for the calendar. |
selected | Date | Date[] | DateRange | — | Currently selected date(s). |
onSelect | (date: Date | undefined) => void | — | Callback when a date is selected. |
disabled | Matcher | Matcher[] | — | Dates to disable (date objects, ranges, or matchers). |
The Calendar component accepts all react-day-picker props including mode, selected, onSelect, disabled, fromDate, toDate, and more.
Accessibility
- Built on
react-day-pickerwhich renders a full ARIA grid calendar - Navigation buttons include
aria-labelattributes ("Go to previous month", "Go to next month") - Days communicate their state via
aria-selected,aria-disabled, andaria-current="date"for today - Full keyboard navigation: Arrow keys move focus between days, Enter/Space select, Page Up/Down navigate months
- Announce the current month/year via
role="heading"on the caption