The DatePicker enables the user to render custom components instead of the default ones and, in this way, to customize most of the child DatePicker components which are otherwise inaccessible.
The user can replace the following DatePicker components with custom ones:
DateInput—Renders the input field in the DatePicker.
Calendar—Renders the Calendar inside the popup week column of the DatePicker.
Popup—Renders the popup which contains the Calendar.
ToggleButton—Render the button which toggles the
showstate of the DatePicker.
PickerWrap—Render the wrapping element around the
The DatePicker and the DateInput components communicate through the
DateInputChangeEvent. In order for the DatePicker to work correctly with any form of date selection, provide a fully working
input which calls the
The following example demonstrates how to replace the default DateInput component with three native
<input /> elements. To enable the user only to change a property and not have full control over the rendered content, pass a modified DateInput.
Similar to the custom rendering of the DateInput, the DatePicker and the Calendar communicate through the
CalendarChangeEvent. You can replace the Calendar with any custom component that provides a date selection and calls
change with a
Date value, a vue
event and an event target.
The following example demonstrates how to replace the default Calendar with a Calendar from the
The Popup component inside the DatePicker acts as a container element with an absolute position. The DatePicker changes the
show property on clicking the Toggle button or on
blur. You can control
show through the DatePicker.
The following example demonstrates how to further customize the Popup—the complete overriding of the Popup is also possible.
The ToggleButton component inside the DatePicker acts as a initial toggle
button for opening the calendar, or closing it without
The following example demonstrates how to further customize the ToggleButton by passing another
icon as a child.—the complete overriding of the ToggleButton is also possible.