Docs
Date-picker

Date Picker

To select or input a date.

Usage

Example Code

1import { DatePicker } from "inc-design-system/datePicker";

Example Code

1const [selectedDate, setSelectedDate] = React.useState<Date | undefined>(
2new Date()
3);
4
5return (
6<DatePicker
7    selected={selectedDate}
8    onSelect={setSelectedDate}
9    placeholder="Select Date"
10/>
11);

Props

DatePicker

PropTypeDescriptionDefault
todayDateThe current date.new Date()
selectedDateThe currently selected date. If a date is selected, it will be displayed in the date picker. If no date is selected, the placeholder text will be displayed instead.-
onSelect(date: Date) => voidA callback function that is called when a date is selected in the date picker. The selected date is passed as an argument to this function.-
placeholderstringThe placeholder text that is displayed in the date picker when no date is selected.'Pick a date'
disabledbooleanA boolean that determines whether the date picker is disabled. If `true`, the date picker is disabled and cannot be interacted with. If `false` or omitted, the date picker is enabled.false
buttonClassNamestringA string that is added to the class list of the button element in the date picker. This can be used to add custom styles to the button.''
dropDownClassNamestringA string that is added to the class list of the dropdown element in the date picker. This can be used to add custom styles to the dropdown.-
calendarClassNamestringA string that is added to the class list of the calendar element in the date picker. This can be used to add custom styles to the calendar.-
disabledDatesMatcher | Matcher[] | undefinedSpecifies which days should be disabled in the calendar. It can disable specific dates, ranges, or days of the week. Supports complex conditions like disabling before, after, or specific days.-
onOpenChangefunctionA function that is called when the visibility of the date picker changes.-
modalbooleanA boolean that determines whether the date picker is displayed as a modal.false