- Accordion
- Avatar
- Badge
- Breadcrumb
- Button
- Calendar
- Checkbox
- Combobox
- Container
- CurrencyInput
- DistributionSlider
- Drawer
- Dropdown
- Grid
- Heading
- Image
- Input
- InputGroup
- Label
- Logo
- MapPin
- Modal
- NativeSelect
- NumberInput
- OtpInput
- PhoneInput
- Popover
- Progress
- PropertyCalendar
- RadioGroup
- RadioGroupCards
- ResponsiveModal
- ScrollArea
- SearchBar
- SearchBarFallback
- SearchInput
- Select
- Separator
- Spinner
- Switch
- Tabs
- Text
- Textarea
- Toast
- Toggle
- ToggleGroup
- Tooltip
Calendar
A date picker calendar component with single, range, and multiple selection modes.
pnpm add @wandercom/design-system-web
import { Calendar } from '@wandercom/design-system-web/ui/calendar';
import { useState } from 'react';
export function Example() {
const [date, setDate] = useState<Date | undefined>();
return (
<Calendar
mode="single"
selected={date}
onSelect={setDate}
/>
);
}Select a single date. The selected date appears with filled styling.
const [date, setDate] = useState<Date | undefined>();
<Calendar
mode="single"
selected={date}
onSelect={setDate}
/>Select a date range with start and end dates. Range endpoints have filled styling while middle dates have a background highlight.
import { DateRange } from 'react-day-picker';
const [range, setRange] = useState<DateRange | undefined>();
<Calendar
mode="range"
selected={range}
onSelect={setRange}
/>Select multiple individual dates. Each selected date appears with filled styling.
const [dates, setDates] = useState<Date[] | undefined>();
<Calendar
mode="multiple"
selected={dates}
onSelect={setDates}
/>Displays the month and year as a static label.
<Calendar captionLayout="label" />Displays month and year as dropdown selects for quick navigation. Requires fromYear and toYear props to define the selectable range.
<Calendar
captionLayout="dropdown"
fromYear={2000}
toYear={2030}
/>Display multiple months side by side using numberOfMonths.
<Calendar
mode="range"
numberOfMonths={2}
/>Restrict selectable dates with fromDate and toDate.
<Calendar
mode="single"
fromDate={new Date()}
toDate={new Date(2027, 11, 31)}
/>Disable specific dates using disabled prop with a matcher function or array.
<Calendar
mode="single"
disabled={(date) => date.getDay() === 0 || date.getDay() === 6}
/>Customize the navigation button variant.
<Calendar buttonVariant="outline" />Customize the navigation button size.
<Calendar buttonSize="icon-sm" />Show days from adjacent months.
<Calendar showOutsideDays />Override internal components for advanced customization.
import { CalendarDayButton } from '@wandercom/design-system-web/ui/calendar';
<Calendar
components={{
DayButton: (props) => (
<CalendarDayButton {...props} className="custom-day" />
),
}}
/>mode?
selected?
onSelect?
captionLayout?
numberOfMonths?
showOutsideDays?
fromDate?
toDate?
fromYear?
toYear?
disabled?
buttonVariant?
buttonSize?
classNames?
components?
formatters?
className?
The Calendar component is built on react-day-picker which follows WAI-ARIA date picker patterns.
Keyboard interaction:
Arrow Left/Right- Navigate between daysArrow Up/Down- Navigate between weeksPage Up/Down- Navigate between monthsShift + Page Up/Down- Navigate between yearsHome- Go to start of weekEnd- Go to end of weekEnter/Space- Select focused dateEscape- Close if in a popover context
Today's date is indicated with a green dot for easy reference.