react-modular-datepicker

Calendar Component API

Complete props and API reference for the Calendar component.

Calendar Component API

The <Calendar /> component renders a full datepicker UI with single, multiple, or range selection modes.


Props Reference

PropTypeDefaultDescription
dateDatenew Date()Initial date/sheet context.
selectedDate | Date[] | { start?: Date; end?: Date }undefinedCurrently selected date value.
selectionMode'single' | 'range' | 'multiple''single'Date selection behavior.
onChange(selected: any) => voidundefinedCallback invoked on date selection changes.
minDateDateundefinedEarliest selectable date bound.
maxDateDateundefinedLatest selectable date bound.
disabledDatesDate[]undefinedArray of specific dates to disable.
monthsToDisplaynumber1Number of concurrent month sheets to display.
firstDayOfWeeknumber0Starting day of the week (0 = Sunday, 1 = Monday).
classNamesCalendarClassNamesundefinedCustom CSS class overrides.
localestringundefinedLocale string for date formatting.
translationsPartial<Translations>undefinedCustom month and weekday name translations.
adapterDateAdapterdefaultAdapterDate management adapter implementation.
headerReact.ReactNodeundefinedCustom header content placed above month sheet headers.
footerReact.ReactNodeundefinedCustom footer content placed below calendar sheets.
onMonthChange(dates: Date[]) => voidundefinedCallback fired when month navigation occurs, providing an array of the first day of each displayed month.
getDayProps(dateObj: DateObj) => Record<string, any>undefinedFunction to return custom props/attributes (e.g. data-tooltip) for day buttons.
modifiersRecord<string, (date: Date, month: number, year: number) => boolean>undefinedCustom modifier rules.

Example Usage

import { useState } from 'react';
import { Calendar } from 'react-modular-datepicker';

export function CalendarExample() {
  const [range, setRange] = useState({});

  return (
    <Calendar
      selectionMode="range"
      monthsToDisplay={2}
      selected={range}
      onChange={(r) => setRange(r)}
    />
  );
}
Live Preview: Date Range Selection
October 2026
SUN
MON
TUE
WED
THU
FRI
SAT
November 2026
SUN
MON
TUE
WED
THU
FRI
SAT
Range: 10/10/2026 – 11/21/2026

On this page