Components

CalendarProvider

Manages shared state across calendar views — selection, bounds, locale, and more.

Props

PropTypeDefaultDescription
formatF"PlainDate"The value format used for date serialization. Determines the type of value, defaultValue, min, max, and callback parameters.
minRawValueForFormat<F>Earliest selectable date. Dates before this are disabled.
maxRawValueForFormat<F>Latest selectable date. Dates after this are disabled.
disabledbooleanfalseWhen true, the entire calendar is disabled.
readOnlybooleanfalseWhen true, the calendar is read-only. Keyboard navigation still works but selection is prevented.
isDateDisabled(date: PlainDate) => booleanCallback to disable individual dates. Return true to disable a date. Called in addition to min/max bounds checking.
timeZonestringThe system's current time zone.IANA time zone identifier used for date/time conversions.
localestring"en-US"BCP 47 locale string used for formatting month names, weekday labels, and other locale-sensitive output.
temporalTemporalNamespaceCustom Temporal namespace for environments without native Temporal support.
weekStartDayWeekStartDay0Day of the week the calendar grid starts on. 0 = Sunday, 1 = Monday, ..., 6 = Saturday.
childrenReact.ReactNodeReact children.
selectionMode"single" | "range" | "multiple""single"
valueRawValueForFormat<F> | DateRange<F> | RawValueForFormat<F>[] | nullThe controlled selected date. Pass null to clear.
defaultValueRawValueForFormat<F> | DateRange<F> | RawValueForFormat<F>[]
onValueChange((value: RawValueForFormat<F> | null, meta: ValueChangeMeta<RawValueForFormat<F> | null>) => void) | ((value: RawValueForFormat<F> | null, meta: ValueChangeMeta<RawValueForFormat<F> | null>) => void) | ((value: DateRange<F> | null, meta: ValueChangeMeta<DateRange<F> | null>) => void) | ((value: DateRange<F> | null, meta: ValueChangeMeta<DateRange<F> | null>) => void) | ((value: RawValueForFormat<F>[], meta: ValueChangeMeta<RawValueForFormat<F>[]>) => void) | ((value: RawValueForFormat<F>[], meta: ValueChangeMeta<RawValueForFormat<F>[]>) => void)

Stable Context

PropTypeDefaultDescription
onSelect*(date: PlainDate) => voidSelects (or toggles) a date, respecting the current selection mode.
setRange*(start: PlainDate, end: PlainDate) => voidProgrammatically sets the range boundaries (normalized so start <= end).
selectionMode*"single" | "range" | "multiple"The active selection mode.
disabled*booleanWhether the entire calendar is disabled.
readOnly*booleanWhether the calendar is read-only.
isDateDisabled(date: PlainDate) => booleanUser-supplied predicate for individually disabled dates.
minValuePlainDateEarliest selectable date (resolved from the min prop).
maxValuePlainDateLatest selectable date (resolved from the max prop).
timeZone*stringResolved IANA time zone.
locale*stringResolved BCP 47 locale.
temporal*TemporalNamespaceResolved Temporal namespace.
weekStartDay*WeekStartDayDay the calendar week starts on.
rangeMode*RangeModeActive range selection mode.
preventRangeReversal*booleanWhether reversed ranges are auto-sorted instead of collapsed.
valueFormat*"object" | "PlainDate" | "PlainDateTime" | "PlainMonthDay" | "PlainTime" | "PlainYearMonth" | "ZonedDateTime" | "Date"The value format discriminant.
setHoveredDate*(date: PlainDate | undefined) => voidSets the hovered date for range preview.

State Context

PropTypeDefaultDescription
selected*DateValueObject | undefinedThe currently selected value as a tagged DateValueObject.
selectedDates*PlainDate[]Flat array of all selected dates (plain dates, sorted).
rangeStart*PlainDate | undefinedStart of the current range selection, or undefined.
rangeEnd*PlainDate | undefinedEnd of the current range selection, or undefined.
hoveredDate*PlainDate | undefinedThe currently hovered date (for range preview).
previewStart*PlainDate | undefinedStart of the computed preview range.
previewEnd*PlainDate | undefinedEnd of the computed preview range.