Calendar

free

Calendar keeps date choices visible for scheduling, booking, and filter workflows.

MoTuWeThFrSaSu
import { useState } from 'react';
import Calendar from '@/components/ui/calendar';

const dateFormatter = new Intl.DateTimeFormat('en', {

Installation

Add this component with the NateUI CLI.

npx nateui@latest add Calendar

Examples

Basic

MoTuWeThFrSaSu
import { useState } from 'react';
import Calendar from '@/components/ui/calendar';

export default function BasicDemo() {

Range

MoTuWeThFrSaSu
import { useState } from 'react';
import Calendar from '@/components/ui/calendar';

export default function RangeDemo() {

Multiple Selection

MoTuWeThFrSaSu
import { useState } from 'react';
import Calendar from '@/components/ui/calendar';

export default function MultipleSelectionDemo() {

Multiple Views

MoTuWeThFrSaSu
MoTuWeThFrSaSu
import { useState } from 'react';
import Calendar from '@/components/ui/calendar';

export default function MultipleViewsDemo() {

Disabled Dates

MoTuWeThFrSaSu
import { useState } from 'react';
import Calendar from '@/components/ui/calendar';

const isWeekend = (date: Date) => date.getDay() === 0 || date.getDay() === 6;

Custom Render

MoTuWeThFrSaSu
import { useState } from 'react';
import Calendar from '@/components/ui/calendar';
import Badge from '@/components/ui/badge';

Mini

July 2026
Mo
Tu
We
Th
Fr
import { useState } from 'react';
import Calendar from '@/components/ui/calendar';

export default function MiniDemo() {

Custom Cell Height

MoTuWeThFrSaSu
import Calendar from '@/components/ui/calendar';

export default function CellHeightDemo() {
  return (

API

Calendar exposes the main Calendar date grid plus Calendar.Range and Calendar.Mini.

Shared Calendar Props

These props are available on Calendar and Calendar.Range unless noted by the component-specific tables below.

PropDescriptionTypeDefault
classNameClass names applied to the calendar root.string-
cellHeightHeight of each day cell in pixels. Use it with the calendar container's available height to control the grid's proportions.number36
dateViewCountNumber of month views rendered side by side.number1
dayClassNameFunction that returns class names for each day cell.CalendarDayClassName-
dayStyleFunction that returns inline styles for each day cell.CalendarDayStyle-
defaultMonthInitial month shown when month is uncontrolled.Datenew Date()
defaultViewInitial picker level.CalendarView'date'
disableDateDisable individual dates.CalendarDisableDate-
disableOutOfMonthDisable dates outside the visible month.booleanfalse
enableHeaderLabelAllow the month and year labels to switch picker level.booleantrue
firstDayOfWeekFirst weekday shown in the calendar grid.FirstDayOfWeek'monday'
focusableAllow day buttons to participate in keyboard focus.booleantrue
fullWidthLet day cells stretch to the full available table width.booleanfalse
hideOutOfMonthDatesHide dates outside the active month instead of muting them.booleanfalse
hideWeekdaysHide the weekday header row.booleanfalse
isDateFirstInRangeMark custom first-in-range dates.CalendarDatePredicate-
isDateInRangeMark custom in-range dates.CalendarDatePredicate-
isDateLastInRangeMark custom last-in-range dates.CalendarDatePredicate-
labelFormatMonth and year format used by the date-view header.CalendarLabelFormat{ month: 'MMM', year: 'YYYY' }
localeLocale passed to date labels. Falls back to ConfigProvider locale.string-
lockViewKeep the current view level after selecting a month or year.booleanfalse
maxDateLatest selectable date.Date-
minDateEarliest selectable date.Date-
monthControlled visible month.Date-
monthLabelFormatMonth label format used by the month picker.string'MMM'
onDayMouseEnterCalled when the pointer enters a day cell.CalendarDayMouseEnterHandler-
onMonthChangeCalled when the visible month changes.CalendarMonthChangeHandler-
paginateByNumber of months to move when navigating.numberdateViewCount
preventFocusPrevent mouse down from moving focus into calendar controls.booleanfalse
rangeHighlighted range shown in the date table. Calendar.Range manages this from value.CalendarRangeHighlight-
renderDayCustom renderer for the content inside each day button.CalendarRenderDay-
weekdayLabelFormatWeekday label format.string'dd'
weekendDaysWeekday indexes treated as weekends.CalendarWeekendDays[0, 6]
yearLabelFormatYear label format used by month/year views.string'YYYY'
refRef forwarded to the root div.Ref<HTMLDivElement>-
...nativeDivPropsNative props for the root div, excluding onChange and value.NativeCalendarDivProps-

Calendar

PropDescriptionTypeDefault
multipleSelectionToggle between single-date and multi-date selection.MultipleSelectionfalse
valueControlled selected date or selected date list.CalendarValue<MultipleSelection>-
onChangeCalled with the selected date or selected date list.CalendarChangeHandler<MultipleSelection>-

Calendar.Range

PropDescriptionTypeDefault
valueControlled start and end dates for the selected range.RangeCalendarValueRequired
onChangeCalled when the user changes the start or end of the range.RangeCalendarChangeHandlerRequired
singleDateAllow selecting the same date as both the start and end.booleanfalse

Calendar.Mini

PropDescriptionTypeDefault
classNameClass names applied to the mini calendar root.string-
valueControlled selected date.Date-
defaultValueInitial selected date when uncontrolled.Datenew Date()
onChangeCalled when the selected mini-calendar date changes.MiniCalendarChangeHandler-
visibleCountNumber of dates shown in the strip.number5
localeLocale passed to mini-calendar labels. Falls back to ConfigProvider locale.string-
weekdayFormatWeekday label format for the date strip.string'ddd'
monthFormatHeader month label format.string'MMMM YYYY'
showHeaderShow the month header and month navigation buttons.booleantrue
showStripNavigationShow previous/next day buttons around the strip.booleantrue
refRef forwarded to the root div.Ref<HTMLDivElement>-
...nativeDivPropsNative props for the root div, excluding onChange, value, and defaultValue.NativeMiniCalendarDivProps-

Types

type CalendarView = 'date' | 'month' | 'year';
type FirstDayOfWeek = 'sunday' | 'monday';
type CalendarLabelFormat = { month: string; year: string };
type CalendarWeekendDays = [number, number];
 
type CalendarDayProps = {
  disabled: boolean;
  weekend: boolean;
  selectedInRange: boolean;
  selected: boolean;
  inRange: boolean;
  firstInRange: boolean;
  lastInRange: boolean;
  outOfMonth: boolean;
};
 
type CalendarDayClassName = (
  date: Date,
  modifiers: CalendarDayProps,
) => string;
 
type CalendarDayStyle = (
  date: Date,
  modifiers: CalendarDayProps,
) => CSSProperties;
 
type CalendarDisableDate = (date: Date) => boolean;
type CalendarDatePredicate =
  | (() => boolean)
  | ((date: Date, modifiers: CalendarDayProps) => boolean);
type CalendarDayMouseEnterHandler = (
  date: Date,
  event: MouseEvent<HTMLButtonElement>,
) => void;
type CalendarMonthChangeHandler = (month: Date) => void;
type CalendarRenderDay = (date: Date) => ReactNode;
type CalendarRangeHighlight = [Date, Date];
 
type CalendarValue<MultipleSelection extends boolean = false> =
  MultipleSelection extends true ? Date[] : Date | null;
type CalendarChangeHandler<MultipleSelection extends boolean = false> = (
  value: CalendarValue<MultipleSelection>,
) => void;
 
type RangeCalendarValue = [Date | null, Date | null];
type RangeCalendarChangeHandler = (value: RangeCalendarValue) => void;
type MiniCalendarChangeHandler = (date: Date) => void;
 
type NativeCalendarDivProps = Omit<ComponentProps<'div'>, 'onChange' | 'value'>;
type NativeMiniCalendarDivProps = Omit<
  ComponentProps<'div'>,
  'onChange' | 'value' | 'defaultValue'
>;