MobileTimePicker API
API reference docs for the React MobileTimePicker component. Learn about the props, CSS, and other APIs of this exported module.
Component demos
Import
import { MobileTimePicker } from '@mui/x-date-pickers/MobileTimePicker';
// or
import { MobileTimePicker } from '@mui/x-date-pickers';
// or
import { MobileTimePicker } from '@mui/x-date-pickers-pro';
Name | Type | Default | Description |
---|---|---|---|
ampm | bool | `utils.is12HourCycleInCurrentLocale()` | 12h/24h view for hour selection clock. |
ampmInClock | bool | true on desktop, false on mobile | Display ampm controls under the clock (instead of in the toolbar). |
autoFocus | bool | If | |
closeOnSelect | bool | `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop). | If |
defaultValue | object | The default value. Used when the component is not controlled. | |
disabled | bool | false | If |
disableFuture | bool | false | If |
disableIgnoringDatePartForTimeValidation | bool | false | Do not ignore date part when validating min/max time. |
disableOpenPicker | bool | false | If |
disablePast | bool | false | If |
format | string | Format of the date when rendered in the input(s). Defaults to localized format based on the used | |
formatDensity | 'dense' | 'spacious' | "dense" | Density of the format when rendered in the input. Setting |
inputRef | ref | Pass a ref to the | |
label | node | The label content. | |
localeText | object | Locale for components texts. Allows overriding texts coming from | |
maxTime | object | Maximal selectable time. The date part of the object will be ignored unless | |
minTime | object | Minimal selectable time. The date part of the object will be ignored unless | |
minutesStep | number | 1 | Step over minutes. |
name | string | Name attribute used by the | |
onAccept | func | Callback fired when the value is accepted. Signature: function(value: TValue) => void
| |
onChange | func | Callback fired when the value changes. Signature: function(value: TValue, context: FieldChangeHandlerContext
| |
onClose | func | Callback fired when the popup requests to be closed. Use in controlled mode (see | |
onError | func | Callback fired when the error associated to the current value changes. If the error has a non-null value, then the Signature: function(error: TError, value: TValue) => void
| |
onOpen | func | Callback fired when the popup requests to be opened. Use in controlled mode (see | |
onSelectedSectionsChange | func | Callback fired when the selected sections change. Signature: function(newValue: FieldSelectedSections) => void
| |
onViewChange | func | Callback fired on view change. Signature: function(view: TView) => void
| |
open | bool | false | Control the popup or dialog open state. |
openTo | 'hours' | 'minutes' | 'seconds' | The default visible view. Used when the component view is not controlled. Must be a valid option from | |
orientation | 'landscape' | 'portrait' | Force rendering in particular orientation. | |
reduceAnimations | bool | `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13 | If |
referenceDate | object | The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`. | The date used to generate the new value when both |
selectedSections | 'all' | 'day' | 'empty' | 'hours' | 'meridiem' | 'minutes' | 'month' | 'seconds' | 'weekDay' | 'year' | number | { endIndex: number, startIndex: number } | The currently selected sections. This prop accept four formats: 1. If a number is provided, the section at this index will be selected. 2. If an object with a | |
shouldDisableTime | func | Disable specific time. Signature: function(value: TDate, view: TimeView) => boolean
Returns: If | |
slotProps | object | {} | The props used for each component slot. |
slots | object | {} | Overridable component slots. See Slots API below for more details. |
sx | Array<func | object | bool> | func | object | The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details. | |
timezone | string | The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise. | Choose which timezone to use for the value. Example: "default", "system", "UTC", "America/New_York". If you pass values from other timezones to some props, they will be converted to this timezone before being used. See the timezones documentation for more details. |
value | object | The selected value. Used when the component is controlled. | |
view | 'hours' | 'minutes' | 'seconds' | The visible view. Used when the component view is controlled. Must be a valid option from | |
viewRenderers | { hours?: func, minutes?: func, seconds?: func } | Define custom view renderers for each section. If | |
views | Array<'hours' | 'minutes' | 'seconds'> | Available views. |
ref
is forwarded to the root element.Slot name | Class name | Default component | Description |
---|---|---|---|
toolbar | TimePickerToolbar | Custom component for the toolbar rendered above the views. | |
previousIconButton | IconButton | Button allowing to switch to the left view. | |
nextIconButton | IconButton | Button allowing to switch to the right view. | |
leftArrowIcon | ArrowLeft | Icon displayed in the left view switch button. | |
rightArrowIcon | ArrowRight | Icon displayed in the right view switch button. | |
actionBar | PickersActionBar | Custom component for the action bar, it is placed below the picker views. | |
shortcuts | PickersShortcuts | Custom component for the shortcuts. | |
dialog | PickersModalDialogRoot | Custom component for the dialog inside which the views are rendered on mobile. | |
textField | TextField from '@mui/material' | Form control with an input to render the value inside the default field. Receives the same props as @mui/material/TextField . | |
layout | Custom component for wrapping the layout. It wraps the toolbar, views, action bar, and shortcuts. | ||
mobilePaper | Paper from '@mui/material'. | Custom component for the paper rendered inside the mobile picker's Dialog. | |
mobileTransition | Fade from '@mui/material'. | Custom component for the mobile dialog Transition. | |
field | Component used to enter the date with the keyboard. |