Calendar

Calendars allow users to view and select dates, date ranges, and other date-based values. They provide the foundation for date selection experiences such as date pickers, booking flows, and scheduling interfaces.

Quick Start

Use a Calendar to allow users to select a date directly from a calendar view.

October 2026
1import { Calendar } from "@ecos/ui";
2
3<Calendar />

Single Date Selection

Use single mode when users need to select one date.

October 2026
1<Calendar
2  mode="single"
3  selected={new Date()}
4/>

Controlled Usage

Calendar selection can be controlled externally using the selected and onSelect props.

October 2026
1const [date, setDate] = useState<Date>();
2
3<Calendar
4  mode="single"
5  selected={date}
6  onSelect={setDate}
7/>

Date Range Selection

Use range mode when users need to select a start and end date.

October 2026
1<Calendar mode="range" />

Multiple Months

Display multiple months to make larger date ranges easier to select.

October 2026
November 2026
1<Calendar
2  mode="range"
3  numberOfMonths={2}
4/>

Use dropdown navigation to allow users to quickly navigate across months and years.

October 2026
1<Calendar
2  captionLayout="dropdown"
3/>

Disabled Dates

Dates can be disabled to prevent unavailable selections.

October 2026
1<Calendar
2  disabled={{
3    before: new Date(),
4  }}
5/>

Localization

Provide a locale to localise month names, weekday names, and formatting.

October 2026
1<Calendar
2  locale={enGB}
3/>

API Reference

Property

Type

Default

Description

mode"single" | "multiple" | "range"-Controls the calendar selection behaviour.
selectedDate | Date[] | DateRange-The selected date or dates.
onSelect(value) => void-Called when the selected value changes.
showOutsideDaysbooleantrueDisplays dates belonging to adjacent months.
captionLayout"label" | "dropdown""label"Controls how month and year navigation is displayed.
numberOfMonthsnumber1Number of months displayed simultaneously.
showWeekNumberbooleanfalseDisplays calendar week numbers.
disabledMatcher | Matcher[]-Disables specific dates from being selected.
buttonVariantButtonVariant"text"Controls the appearance of the navigation buttons.
localeLocale-Localises month names, weekday names, and date formatting.
classNamestring-Additional classes applied to the calendar container.

Visual Reference

Configuration

Preview

Single Selection
October 2026
Range Selection
October 2026
Two Months
October 2026
November 2026
Dropdown Navigation
October 2026
Week Numbers
October 2026
40
41
42
43
44
Disabled Dates
October 2026