MtDatepicker component allows users to select dates, times, or datetime values with an interactive calendar interface.
Import
Props
The value of the date picker. Can be a single value or an array for ranges.
A label for your date picker field.
Defines the type of the date picker.
Sets the locale for the date picker. Affects language used for month names and weekdays.
The format of the date picker. Defaults to ‘yyyy/MM/dd’ for date, ‘HH:mm’ for time, ‘yyyy/MM/dd, HH:mm’ for datetime.
Defines the time zone for the date picker.
Placeholder text to show when no date is selected.
Determines if the timepicker is in 24 or 12 hour format.
Determines if the date picker field is required.
Determines if the date picker field is disabled.
Enables the date range selection feature.
Sets the size of the datepicker.
The minimum selectable date. Dates before this will be disabled.
The increment for hours in the time picker grid.
The increment for minutes in the time picker grid.
Enables typing directly into the input field.
Help text for the date picker.
An error in your business logic related to this field.
Events
Emitted when the date value changes.
Usage
Basic Date Picker
DateTime Picker
Time Picker
Date Range
With Minimum Date
Small Size
Accessibility
- Keyboard navigation through calendar (arrow keys)
- Escape key closes the picker
- Tab navigation through all interactive elements
- Screen reader support with ARIA labels
- Clear button accessible via keyboard
- Error states communicated via aria-invalid and aria-describedby