KeyboardDatePicker API
Here you can find the full list and description for KeyboardDatePicker props.
Import
import { KeyboardDatePicker } from '@material-ui/pickers'
Inheritance
Any prop not recognized by the pickers and their sub-components are passed down to material-ui TextField component.
DateIOType
— date object type of your linked date-io adapter (Moment, DayJS, etc.)
Props
Name | Type | Default | Description |
---|---|---|---|
onChange * |
| Keyboard onChange callback | |
value * |
| Picker value | |
allowKeyboardControl |
| true | Enables keyboard listener for moving between days in calendar |
animateYearScrolling |
| false | To animate scrolling to current year (using scrollIntoView) |
autoOk |
| false | Auto accept date on selection |
disabled |
| Disable picker and text field | |
disableFuture |
| false | Disable future dates |
disablePast |
| false | Disable past dates |
disableToolbar |
| false | Hide toolbar and show only date/time views |
emptyLabel |
| ' ' | Message displaying in text field, if null passed (doesn't work in keyboard mode) |
format |
| Format string | |
initialFocusedDate |
| Date that will be initially highlighted if null was passed | |
InputAdornmentProps |
| Props to pass to keyboard input adornment | |
inputValue |
| String value for controlling value with pure input string. Overrides value prop | |
inputVariant |
| Pass material-ui text field variant down, bypass internal variant prop | |
invalidDateMessage |
| 'Invalid Date Format' | Message, appearing when date cannot be parsed |
invalidLabel |
| 'unknown' | Message displaying in text field if date is invalid (doesn't work in keyboard mode) |
KeyboardButtonProps |
| Props to pass to keyboard adornment button | |
keyboardIcon |
| Icon displaying for open picker button | |
labelFunc |
| Dynamic formatter of text field value | |
leftArrowButtonProps |
| Props to pass to left arrow button | |
leftArrowIcon |
| Left arrow icon | |
loadingIndicator |
| Custom loading indicator | |
mask |
| Custom mask. Can be used to override generate from format. (e.g. __/__/____ __:__) | |
maskChar |
| '_' | Char string that will be replaced with number (for "_" mask will be "__/__/____") |
maxDate |
| Date(2100-01-01) | Max selectable date |
maxDateMessage |
| 'Date should not be after maximal date' | Error message, shown if date is more then maximal date |
minDate |
| Date(1900-01-01) | Min selectable date |
minDateMessage |
| 'Date should not be before minimal date' | Error message, shown if date is less then minimal date |
onAccept |
| Callback fired when date is accepted | |
onClose |
| On close callback | |
onError |
| Callback fired when new error should be displayed (!! This is a side effect. Be careful if you want to rerender the component) | |
onMonthChange |
| Callback firing on month change. Return promise to render spinner till it will not be resolved | |
onOpen |
| On open callback | |
onYearChange |
| Callback firing on year change | |
open |
| Controlled picker open state | |
openTo |
| First view to show in DatePicker | |
orientation |
| "portrait" | Force rendering in particular orientation |
PopoverProps |
| Popover props passed to material-ui Popover (with variant="inline") | |
readOnly |
| Make picker read only | |
refuse |
| /[^\d]+/gi | Refuse values regexp |
renderDay |
| Custom renderer for day | |
rifmFormatter |
| Custom formatter to be passed into Rifm component | |
rightArrowButtonProps |
| Props to pass to right arrow button | |
rightArrowIcon |
| Right arrow icon | |
shouldDisableDate |
| Disable specific date | |
strictCompareDates |
| false | Compare dates by the exact timestamp, instead of start/end of date |
TextFieldComponent |
| Override input component | |
ToolbarComponent |
| Component that will replace default toolbar renderer | |
variant |
| 'dialog' | Picker container option |
views |
| Array of views to show |
Modal Wrapper
Available only with variant "dialog"
Name | Type | Default | Description |
---|---|---|---|
cancelLabel |
| Cancel | "CANCEL" label message |
clearable |
| Show clear action in picker dialog | |
clearLabel |
| Clear | "CLEAR" label message |
DialogProps |
| Props to be passed directly to material-ui Dialog | |
okLabel |
| OK | "OK" label message |
showTodayButton |
| If true today button will be displayed Note* that clear button has higher priority | |
todayLabel |
| Today | "TODAY" label message |