Docs
Calendar

Calendar

A container that displays data in calendar form.

SuMoTuWeThFrSa

Usage

Example Code

1import { Calendar } from "inc-design-system/calendar";

Example Code

1const [date, setDate] = React.useState<Date | undefined>(new Date());
2  
3return <Calendar mode="single" selected={date} onSelect={setDate} />;

Props

Calendar

For more props:

PropTypeDescriptionDefault
classNamestringThe class name of the calendar.-
classNamesobjectThe class names for the calendar.-
showOutsideDaysbooleanWhether to show outside days or not.true
todayDateThe current date.new Date()
selectedDate | Date[] | CalendarDateRange | undefinedThe selected date. Type `Date` for 'single' mode, `Date[]` for 'multiple' mode, and `CalendarDateRange` for 'range' mode.-
onSelect(selected: Date | Date[] | CalendarDateRange | undefined) => voidCallback function that is called when a date or a range of dates is selected.-
onDayClick(date: Date) => voidThe function to call when a day is clicked.-
disabledDate[]The dates that should be disabled.[]
hiddenDate[]The dates that should be hidden.[]
mode'single' | 'multiple' | 'range'The selection mode. Default is 'single'.'single'
propsobjectThe other props for the DayPicker component by React Day Picker.-