Skip to content
FormsInteractive playground

Calendar

Date selection in a calendar view.

Preparing the playground…
Text and Markdown example
Calendar · Example
1function Example() { 2 const [date, setDate] = useState<Date | undefined>(new Date(2026, 8, 9)); 3 return <Calendar mode="single" selected={date} onSelect={setDate} defaultMonth={new Date(2026, 8, 1)} />; 4}
Read documentation in Markdown

How to use it

Based on DayPicker. Combine mode="single" with selected and onSelect; use mode="range" for date ranges.

Import

React / Next.js
1import { Calendar } from "@kivora/nextjs";

Interactive examples run inside a component with "use client". The playground's Copy button includes the imports needed for the current example.

API reference 0.2.0

Types from the installed published version, including component properties and common HTML attributes. “Optional” does not imply a default value; omitting a property lets the component decide.

PropertyTypeDescription
selectedRequiredDate | Date[] | Date[] | DateRange | DateRangeSelected date or dates.
animatebooleanEnable or disable animation.
aria-labelstringAccessible name of the control.
aria-labelledbystringThe aria-labelledby attribute to add to the container element.
autoFocusbooleanWhen a selection mode is set, DayPicker will focus the first selected day (if set) or today's date (if not disabled). Use this prop when you need to focus DayPicker after a user action, for improved accessibility.
broadcastCalendarbooleanDisplay the weeks in the month following the broadcast calendar. Setting this prop will ignore {@link weekStartsOn} (always Monday) and {@link showOutsideDays} will default to true.
captionLayout"label" | "dropdown" | "dropdown-months" | "dropdown-years"Show dropdowns to navigate between months or years. - `label`: Displays the month and year as a label. Default value. - `dropdown`: Displays dropdowns for both month and year navigation. - `dropdown-months`: Displays a dropdown only for the month navigation. - `dropdown-years`: Displays a dropdown only for the year navigation. **Note:** By default, showing the dropdown will set the {@link startMonth} to 100 years ago and {@link endMonth} to the end of the current year. You can override this behavior by explicitly setting `startMonth` and `endMonth`.
classNamestringAdditional CSS classes to customize the element.
classNamesPartial<ClassNames>Change the class names used by DayPicker. Use this prop when you need to change the default class names — for example, when importing the style via CSS modules or when using a CSS framework.
componentsPartial<CustomComponents>Change the components used for rendering the calendar elements.
dateLibPartial<DateLib>Replace the default date library with a custom one. Experimental: not guaranteed to be stable (may not respect semver).
defaultMonthDateThe initial month to show in the calendar. Use this prop to let DayPicker control the current month. If you need to set the month programmatically, use {@link month} and {@link onMonthChange}.
dirstringInterface reading direction.
disabledMatcher | Matcher[]Disable interaction with the control.
disableNavigationbooleanDisable the navigation between months. This prop won't hide the navigation: to hide the navigation, use {@link hideNavigation}.
endMonthDateThe latest month to end the month navigation.
excludeDisabledbooleanWhen `true`, the range will reset when including a disabled day.
firstWeekContainsDate1 | 4The day of January that is always in the first week of the year.
fixedWeeksbooleanDisplay always 6 weeks per each month, regardless of the month’s number of weeks. Weeks will be filled with the days from the next month.
footerReactNodeAdd a footer to the calendar, acting as a live region. Use this prop to communicate the calendar's status to screen readers. Prefer strings over complex UI elements.
formattersPartial<Formatters>Formatters used to format dates to strings. Use this prop to override the default functions.
fullWidthbooleanConfigures fullWidth. The type describes the supported values and structure.
hiddenMatcher | Matcher[]Apply the `hidden` modifier to the matching days. Will hide them from the calendar.
hideNavigationbooleanHide the navigation buttons. This prop won't disable the navigation: to disable the navigation, use {@link disableNavigation}.
hideWeekdaysbooleanHide the row displaying the weekday row header.
idstringElement identifier; associates labels and descriptions.
ISOWeekbooleanUse ISO week dates instead of the locale setting. Setting this prop will ignore `weekStartsOn` and `firstWeekContainsDate`.
labelsPartial<Labels>Labels creators to override the defaults. Use this prop to customize the aria-label attributes in DayPicker.
langstringAdd the language tag to the container element. When omitted, DayPicker uses the active locale code (`locale.code`). Set this prop to override the language tag.
localePartial<DayPickerLocale>Localization in the format expected by the component.
maxnumberMaximum allowed value.
minnumberMinimum allowed value.
mode"single" | "multiple" | "multiple" | "range" | "range" | undefinedSelection mode.
modifiersRecord<string, Matcher | Matcher[]>Add modifiers to the matching days.
modifiersClassNamesModifiersClassNamesChange the class name for the day matching the `modifiers`.
modifiersStylesModifiersStylesChange the class name for the day matching the {@link modifiers}.
monthDateThe month displayed in the calendar. As opposed to `defaultMonth`, use this prop with `onMonthChange` to change the month programmatically.
navLayout"around" | "after"Adjust the positioning of the navigation buttons. - `around`: Displays the buttons on either side of the caption. - `after`: Displays the buttons after the caption. This ensures the tab order matches the visual order. If not set, DayPicker preserves its legacy layout, but the tab order may not align with the visual order when using `captionLayout="dropdown"`.
noncestringA cryptographic nonce ("number used once") which can be used by Content Security Policy for the inline `style` attributes.
noonSafebooleanKeep calendar math at noon in the configured {@link timeZone} to avoid historical second-level offsets drifting dates across midnight. This prop sets the time of the dates to noon (12:00).
numberOfMonthsnumberThe number of displayed months.
numerals"latn" | "arab" | "arabext" | "deva" | "geez" | "beng" | "guru" | "gujr" | "orya" | "tamldec" | "telu" | "knda" | "mlym" | "thai" | "mymr" | "khmr" | "laoo" | "tibt"The numeral system to use when formatting dates. - `latn`: Latin (Western Arabic) - `arab`: Arabic-Indic - `arabext`: Eastern Arabic-Indic (Persian) - `deva`: Devanagari - `beng`: Bengali - `guru`: Gurmukhi - `gujr`: Gujarati - `orya`: Oriya - `tamldec`: Tamil - `telu`: Telugu - `knda`: Kannada - `mlym`: Malayalam
onDayBlurDayEventHandler<FocusEvent<Element, Element>>Event handler when a day is blurred.
onDayClickDayEventHandler<MouseEvent<Element, MouseEvent>>Event handler when a day is clicked.
onDayFocusDayEventHandler<FocusEvent<Element, Element>>Event handler when a day is focused.
onDayKeyDownDayEventHandler<KeyboardEvent<Element>>Event handler when a key is pressed on a day.
onDayMouseEnterDayEventHandler<MouseEvent<Element, MouseEvent>>Event handler when the mouse enters a day.
onDayMouseLeaveDayEventHandler<MouseEvent<Element, MouseEvent>>Event handler when the mouse leaves a day.
onMonthChangeMonthChangeEventHandlerEvent fired when the user navigates between months.
onNextClickMonthChangeEventHandlerEvent handler when the next month button is clicked.
onPrevClickMonthChangeEventHandlerEvent handler when the previous month button is clicked.
onSelectOnSelectHandler<Date> | OnSelectHandler<Date[]> | OnSelectHandler<Date[]> | OnSelectHandler<DateRange> | OnSelectHandler<DateRange>Action or selection made by the user.
pagedNavigationbooleanPaginate the month navigation displaying the `numberOfMonths` at a time.
requiredfalse | true | false | true | false | true | undefinedIndicates that a value is required.
resetOnSelectbooleanWhen `true`, clicking a day starts a new range if there is no current start date or if a range is already complete. In those cases, the clicked day becomes the start of the new range.
reverseMonthsbooleanRender the months in reversed order (when {@link numberOfMonths} is set) to display the most recent month first.
reverseYearsbooleanReverse the order of years in the dropdown when using `captionLayout="dropdown"` or `captionLayout="dropdown-years"`.
role"dialog" | "application"Semantic role of the element. Keep the default role unless a change is justified.
showOutsideDaysbooleanShow the outside days (days falling in the next or the previous month). **Note:** when a {@link broadcastCalendar} is set, this prop defaults to true.
showWeekNumberbooleanShow the week numbers column. Weeks are numbered according to the local week index.
startMonthDateThe earliest month to start the month navigation.
styleCSSPropertiesReact inline styles.
stylesPartial<Styles>Change the inline styles of the HTML elements.
timeZonestringThe time zone (IANA or UTC offset) to use in the calendar (experimental). See [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for the possible values.
titlestringTitle or supplementary information.
todayDateThe today’s date. Default is the current date. This date will get the `today` modifier to style the day.
useAdditionalDayOfYearTokensbooleanEnable `YY` and `YYYY` for day of year tokens when formatting or parsing dates.
useAdditionalWeekYearTokensbooleanEnable `DD` and `DDDD` for week year tokens when formatting or parsing dates.
weekStartsOn0 | 1 | 2 | 3 | 4 | 5 | 6The index of the first day of the week (0 - Sunday). Overrides the locale's default.

TypeScript definition

Review each component's properties and published declaration. Native and accessibility attributes are inherited from the element specified by its type.

Calendar69 properties
Calendar · TypeScript
1declare function Calendar({ className, classNames, showOutsideDays, components, fullWidth, ...props }: CalendarProps): React.JSX.Element;
API generated from @kivora/nextjs 0.2.0View package