Skip to main content

API Reference

Shared props

These props are available on both Calendar and ScrollableCalendar.

PropTypeDescription
selectedCalendarSelected[]Selected date array. Accepts one or two values.
reservedCalendarReserved[]Reserved booking intervals.
componentsCalendarComponentsPartial map of component overrides.
classNamesCalendarClassNamesPartial map of extra class names for inner parts.
disabledboolean | ((date, state) => boolean)Disables the whole calendar or individual days.
isStartbooleanIn non-range mode, controls whether the next selection writes the start or end side.
optionsCalendarOptionsLocale, week start, and attribute settings.
rangebooleanEnables start-plus-end selection flow.
protectionbooleanEnables overbooking protection. Defaults to true for Calendar and false for ScrollableCalendar.
onOverbook(date, overbookType) => voidCalled when a blocked selection is attempted.
onChange(selected) => voidReceives the next selected interval.

Calendar

Additional props:

PropTypeDescription
initialDateDate | number | nullStarting month when navigation is uncontrolled.
monthCalendarMonthControlled visible month.
yearnumberControlled visible year.
onMonthChange(month, year) => voidCalled after month navigation.
onYearChange(year) => voidCalled when navigation rolls into another year.

ScrollableCalendar

Additional props:

PropTypeDescription
startMonthCalendarDateFirst month in the virtualized timeline.
monthsCountnumberNumber of months to generate into the list.
colHeightnumberHeight of each grid row in pixels.
initialScrollCalendarDate | nullDate used for the initial scroll offset.
onScroll(event) => voidScroll callback from react-window.

CalendarOptions

type CalendarOptions = {
locale?: Intl.LocalesArgument;
weekStartsOn?: number;
useAttributes?: boolean;
};

locale localizes the built-in month, weekday, day, and aria labels while the calendar calculations remain Gregorian.

useAttributes enables data-* attributes on the day elements so you can style state directly in CSS.

CalendarReserved

type CalendarReserved = {
startDate: CalendarDate;
endDate: CalendarDate;
color?: string;
};

CalendarDate

type CalendarDate = Date | number | string;

Exported helper return types

type GetProtectedTimeReturn = {
startDate: Date;
endDate: Date;
};

type GetProtectedIntervalReturn = {
interval: CalendarSelected[] | null;
overbookType: OverbookTypes | null;
};

Exported override prop types

The package exports prop types for the internal parts you can replace:

  • CalendarContainerProps
  • WeekContainerProps
  • DaysContainerProps
  • DayContainerProps
  • MonthArrowBackProps
  • MonthContentProps
  • MonthArrowNextProps
  • WeekContentProps
  • DayContentProps
  • DayTodayProps
  • DayReservationProps
  • DaySelectionProps