DatePickerProps
Represents the props of the KendoReact DatePicker component.
Definition
Package:@progress/kendo-react-dateinputs
Properties
adaptive?
boolean
Enable adaptive rendering of the popup based on viewport width.
false
adaptiveSubtitle?
string
Set the subtitle text in the adaptive popup (action sheet). Use only when adaptive is true.
adaptiveTitle?
string
Set the title text in the adaptive popup (action sheet). Use only when adaptive is true.
If not set, the title matches the label.
allowCaretMode?
boolean
Determines if the users should see a blinking caret inside the Date Input when possible.
false
ariaDescribedBy?
string
Identifies the element(s) which will describe the component, similar to HTML aria-describedby attribute.
For example these elements could contain error or hint message.
Example usage of the ariaDescribedBy property:
<DatePicker ariaDescribedBy="description-id" />
ariaLabel?
string
The accessible label of the component.
Example usage of the ariaLabel property:
<DatePicker ariaLabel="Date Picker" />
ariaLabelledBy?
string
Identifies the element(s) which will label the component.
Example usage of the ariaLabelledBy property:
<DatePicker ariaLabelledBy="label-id" />
autoCorrectParts?
boolean
Determines whether to autocorrect invalid segments automatically.
true
autoFill?
boolean
Autofill missing date parts with the current date on blur.
false
autoFocus?
boolean
Apply the autoFocus attribute to the internal input element.
false
autoSwitchKeys?
string[]
A string array representing custom keys, which will move the focus to the next date format segment.
[]
autoSwitchParts?
boolean
Determines whether to automatically move to the next segment after the user completes the current one.
true
calendar?
ComponentType<CalendarProps<any>> | ComponentType<MultiViewCalendarProps<any>>
Allows you to customize or replace the default Calendar rendered by DatePicker.
(see example).
Example usage of the calendar property:
<DatePicker calendar={CustomCalendar} />
className?
string
Sets the className of the DatePicker.
Example usage of the className property:
<DatePicker className="custom-class" />
dateInput?
ComponentType<DateInputProps<any>>
Allows you to customize or replace the default DateInput rendered by DatePicker.
(see example).
Example usage of the dateInput property:
<DatePicker dateInput={CustomDateInput} />
defaultShow?
boolean
Sets the default state of the DatePicker upon render (see example).
Example usage of the defaultShow property:
<DatePicker defaultShow={true} />
defaultValue?
null | Date
Set the initial value when the component is uncontrolled (see example).
disabled?
boolean
Determines whether the DatePicker is disabled (see example).
Example usage of the disabled property:
<DatePicker disabled={true} />
enableMouseWheel?
boolean
Enable mouse wheel to increment or decrement segments.
true
fillMode?
"solid" | "flat" | "outline"
Control the fillMode (background) of the DatePicker.
The available options are:
- solid
- outline
- flat
undefined (theme-controlled)
focusedDate?
Date
Specifies the focused date of the DatePicker (see example).
Example usage of the focusedDate property:
<DatePicker focusedDate={new Date()} />
format?
string | DateFormatOptions
Specifies the date format that is used to display the input value (see example).
Example usage of the format property:
<DatePicker format="MM/dd/yyyy" />
Defines the descriptions of the format sections in the input field (more information and examples).
Example usage of the formatPlaceholder property:
<DatePicker formatPlaceholder="Enter date" />
id?
string
Specifies the id of the DatePicker.
Example usage of the id property:
<DatePicker id="datepicker-id" />
inputAttributes?
InputHTMLAttributes<HTMLInputElement>
Pass HTML attributes to the internal focusable input element. Attributes required for core logic are ignored.
label?
ReactNode
Renders a floating label for the DatePicker.
Example usage of the label property:
<DatePicker label="Date Picker Label" />
max?
Date
Specifies the greatest valid date (see example).
Example usage of the max property:
<DatePicker max={new Date(2099, 11, 31)} />
min?
Date
Specifies the smallest valid date (see example).
Example usage of the min property:
<DatePicker min={new Date(1900, 0, 1)} />
name?
string
Specifies the name property of the input DOM element.
Example usage of the name property:
<DatePicker name="datepicker-name" />
onBlur?
(event: FocusEvent<HTMLDivElement | HTMLSpanElement, Element>) => void
Fires each time any of the DatePicker elements gets blurred.
Example usage of the onBlur property:
<DatePicker onBlur={(event) => console.log('Blur event:', event)} />
onChange?
(event: DatePickerChangeEvent) => void
Fires when the user selects a new value (see example).
onClose?
(event: DatePickerCloseEvent) => void
Fires when the popup closes.
onFocus?
(event: FocusEvent<HTMLDivElement | HTMLSpanElement, Element>) => void
Fires each time the user focuses any of the DatePicker elements.
Example usage of the onFocus property:
<DatePicker onFocus={(event) => console.log('Focus event:', event)} />
onOpen?
(event: DatePickerOpenEvent) => void
Fires when the popup opens.
placeholder?
null | string
Specifies the hint the DateInput displays when its value is null or there is no partial selection.
For more information, refer to the article on
placeholders.
Example usage of the placeholder property:
<DatePicker placeholder="Enter a date" />
popup?
ComponentType<PopupProps>
Allows you to customize or replace the default Popup rendered by DatePicker.
(see example).
Example usage of the popup property:
<DatePicker popup={CustomPopup} />
Configures the popup options of the DatePicker.
The available options are:
animate: Boolean—Controls the popup animation. By default, the open and close animations are enabled.appendTo: — Defines the container to which the Popup will be appended. Defaults tobody.popupClass: String—Specifies a list of CSS classes that are used to style the popup.
Example usage of the popupSettings property:
<DatePicker popupSettings={{ animate: true, popupClass: 'custom-popup' }} />
required?
boolean
Specifies if null is a valid value for the component.
This property is part of the FormComponentProps interface.
rounded?
"small" | "medium" | "large" | "full" | "none"
Control the corner rounded style of the DatePicker.
The available options are:
- small
- medium
- large
- full
- none
undefined (theme-controlled)
show?
boolean
Specifies if the calendar will be displayed (see example).
Example usage of the show property:
<DatePicker show={true} />
size?
"small" | "medium" | "large"
Control the size of the DatePicker.
The available options are:
- small
- medium
- large
undefined (theme-controlled)
tabIndex?
number
Sets the tabIndex property of the DatePicker.
Example usage of the tabIndex property:
<DatePicker tabIndex={0} />
title?
string
Sets the title of the input element of the DatePicker.
Example usage of the title property:
<DatePicker title="Date Picker Title" />
toggleButton?
ComponentType<ToggleButtonProps>
Allows you to customize or replace the default Toggle button rendered by DatePicker.
(see example).
Example usage of the toggleButton property:
<DatePicker toggleButton={CustomToggleButton} />
twoDigitYearMax?
number
Set the upper threshold for interpreting a two-digit year as part of the current century (see example).
Values smaller than (twoDigitYearMax + 1) map to 20xx. Larger map to 19xx.
68
valid?
boolean
Overrides the validity state of the component.
If valid is set, the required property will be ignored.
This property is part of the FormComponentProps interface.
validationMessage?
string
Controls the form error message of the component. If set to an empty string, no error will be thrown.
This property is part of the FormComponentProps interface.
validityStyles?
boolean
If set to false, no visual representation of the invalid state of the component will be applied.
This property is part of the FormComponentProps interface.
value?
null | Date
Set the current value (see example).
Provide a valid JavaScript Date instance or null.
webMcp?
boolean | WebMcpProps
Enables Web MCP tool registration for this component.
Requires a parent WebMcpProvider from @progress/kendo-react-webmcp.
weekNumber?
boolean
Determines whether to display a week number column in the month view of the Calendar (see example).
Example usage of the weekNumber property:
<DatePicker weekNumber={true} />
width?
string | number
Specifies the width of the DatePicker.
Example usage of the width property:
<DatePicker width="300px" />