New to KendoReactLearn about KendoReact Free.

DatePickerProps

Represents the props of the KendoReact DatePicker component.

NameTypeDefaultDescription

adaptive?

boolean

Providing different rendering of the popup element based on the screen dimensions.

adaptiveTitle?

string

Specifies the text that is rendered as title in the adaptive popup.

allowCaretMode?

boolean

false

Determines if the users should see a blinking caret inside the Date Input when possible.

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:

jsx
<DatePicker ariaDescribedBy="description-id" />

ariaLabel?

string

The accessible label of the component. Example usage of the ariaLabel property:

jsx
<DatePicker ariaLabel="Date Picker" />

ariaLabelledBy?

string

Identifies the element(s) which will label the component. Example usage of the ariaLabelledBy property:

jsx
<DatePicker ariaLabelledBy="label-id" />

autoCorrectParts?

boolean

true

Determines whether to autocorrect invalid segments automatically.

autoFill?

boolean

false

When enabled, the DatePicker will autofill the rest of the date to the current date when the component loses focus.

autoFocus?

boolean

Represents the autoFocus HTML attribute that will be applied to the input element of the DatePicker. (Defaults to false)

autoSwitchKeys?

string[]

[]

A string array representing custom keys, which will move the focus to the next date format segment.

autoSwitchParts?

boolean

true

Determines whether to automatically move to the next segment after the user completes the current one.

calendar?

ComponentType<CalendarProps<any>> | ComponentType<MultiViewCalendarProps<any>>

Enables the customization or the override of the default Calendar which is rendered by the DatePicker (see example). Example usage of the calendar property:

jsx
<DatePicker calendar={CustomCalendar} />

className?

string

Sets the className of the DatePicker. Example usage of the className property:

jsx
<DatePicker className="custom-class" />

dateInput?

React.ComponentType<DateInputProps<any>>

Enables the customization or the override of the default DateInput which is rendered by the DatePicker (see example). Example usage of the dateInput property:

jsx
<DatePicker dateInput={CustomDateInput} />

defaultShow?

boolean

Sets the default state of the DatePicker upon render (see example). Example usage of the defaultShow property:

jsx
<DatePicker defaultShow={true} />

defaultValue?

"null" | Date

Sets the default value of the DatePicker (see example).

disabled?

boolean

Determines whether the DatePicker is disabled (see example). Example usage of the disabled property:

jsx
<DatePicker disabled={true} />

enableMouseWheel?

boolean

true

Indicates whether the mouse scroll can be used to increase/decrease the date segments values.

fillMode?

"null" | "flat" | "solid" | "outline"

solid

Configures the fillMode of the DatePicker.

The available options are:

  • solid
  • outline
  • flat
  • null—Does not set a fillMode className.

focusedDate?

Date

Specifies the focused date of the DatePicker (see example). Example usage of the focusedDate property:

jsx
<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:

jsx
<DatePicker format="MM/dd/yyyy" />

formatPlaceholder?

DateInputFormatPlaceholder

Defines the descriptions of the format sections in the input field (more information and examples). Example usage of the formatPlaceholder property:

jsx
<DatePicker formatPlaceholder="Enter date" />

id?

string

Specifies the id of the DatePicker. Example usage of the id property:

jsx
<DatePicker id="datepicker-id" />

inputAttributes?

React.InputHTMLAttributes<HTMLInputElement>

Sets the HTML attributes of the inner focusable input element. Attributes which are essential for certain component functionalities cannot be changed.

label?

string

Renders a floating label for the DatePicker. Example usage of the label property:

jsx
<DatePicker label="Date Picker Label" />

max?

Date

Specifies the greatest valid date (see example). Example usage of the max property:

jsx
<DatePicker max={new Date(2099, 11, 31)} />

min?

Date

Specifies the smallest valid date (see example). Example usage of the min property:

jsx
<DatePicker min={new Date(1900, 0, 1)} />

name?

string

Specifies the name property of the input DOM element. Example usage of the name property:

jsx
<DatePicker name="datepicker-name" />

onBlur?

(event: FocusEvent<HTMLDivElement | HTMLSpanElement>) => void

Fires each time any of the DatePicker elements gets blurred. Example usage of the onBlur property:

jsx
<DatePicker onBlur={(event) => console.log('Blur event:', event)} />

onChange?

(event: DatePickerChangeEvent) => void

Fires each time the user selects a new value (see example).

onClose?

(event: DatePickerCloseEvent) => void

Fires each time the popup is closed.

onFocus?

(event: FocusEvent<HTMLDivElement | HTMLSpanElement>) => void

Fires each time the user focuses any of the DatePicker elements. Example usage of the onFocus property:

jsx
<DatePicker onFocus={(event) => console.log('Focus event:', event)} />

onOpen?

(event: DatePickerOpenEvent) => void

Fires each time the popup is opened.

pickerWrap?

React.ComponentType<PickerWrapProps>

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:

jsx
<DatePicker placeholder="Enter a date" />

React.ComponentType<PopupProps>

Enables the customization or the override of the default Popup which is rendered by the DatePicker (see example). Example usage of the popup property:

jsx
<DatePicker popup={CustomPopup} />

popupSettings?

DateInputsPopupSettings

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 to body.
  • popupClass: String—Specifies a list of CSS classes that are used to style the popup.

Example usage of the popupSettings property:

jsx
<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?

"null" | "small" | "large" | "medium" | "full"

medium

Configures the roundness of the DatePicker.

The available options are:

  • small
  • medium
  • large
  • full
  • null—Does not set a rounded className.

show?

boolean

Specifies if the calendar will be displayed (see example). Example usage of the show property:

jsx
<DatePicker show={true} />

size?

"null" | "small" | "large" | "medium"

medium

Configures the size of the DatePicker.

The available options are:

  • small
  • medium
  • large
  • null—Does not set a size className.

tabIndex?

number

Sets the tabIndex property of the DatePicker. Example usage of the tabIndex property:

jsx
<DatePicker tabIndex={0} />

title?

string

Sets the title of the input element of the DatePicker. Example usage of the title property:

jsx
<DatePicker title="Date Picker Title" />

toggleButton?

React.ComponentType<ToggleButtonProps>

Enables the customization or the override of the default Toggle button which is rendered by the DatePicker (see example). Example usage of the toggleButton property:

jsx
<DatePicker toggleButton={CustomToggleButton} />

twoDigitYearMax?

number

68

The maximum year to assume to be from the current century when typing two-digit year value (see example). The default value of 68, indicating that typing any value less than 69 will be assumed to be 20xx, while 69 and larger will be assumed to be 19xx.

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

Specifies the value of the DatePicker (see example).

The value has to be a valid JavaScript Date instance.

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:

jsx
<DatePicker weekNumber={true} />

width?

string | number

Specifies the width of the DatePicker. Example usage of the width property:

jsx
<DatePicker width="300px" />
Not finding the help you need?
Contact Support