Component composition
The component is built using the
TimeField for the keyboard editing,
the DigitalClock for the desktop
view editing, and the TimeClock for
the mobile view editing.
Check out their documentation page for more information:
You can check the available props of the
combined component on the dedicated
API page. Some
TimeField props
are not available on the Picker component, you
can use slotProps.field to pass
them to the field.
Uncontrolled vs. controlled value
The value of the component can be uncontrolled or controlled.
Available components
The component is available in four variants:
-
The
DesktopTimePickercomponent which works best for mouse devices and large screens. It renders the views inside a popover and a field for keyboard editing. -
The
MobileTimePickercomponent which works best for touch devices and small screens. It renders the view inside a modal and a field for keyboard editing. -
The
TimePickercomponent which rendersDesktopTimePickerorMobileTimePickerdepending on the device it runs on. -
The
StaticTimePickercomponent which renders without the popover/modal and field.
Desktop variant
Mobile variant
Responsive variant
Static variant
By default, the
TimePicker component renders the
desktop version if the media query
@media (pointer: fine)
matches. This can be customized with the
desktopModeMediaQuery prop.
Form props
The component supports the
disabled, readOnly and
name form props:
Views
The component supports three views:
hours, minutes and
seconds.
By default, the hours and
minutes views are enabled. Use the
views prop to change this behavior:
"hours", "minutes" and "seconds"
"hours"
"minutes" and "seconds"
By default, the
MobileTimePicker component renders
the hours view on mount. Use the
openTo prop to change this
behavior:
Landscape orientation
By default, the Time Picker component
automatically sets the orientation based on the
window.orientation value.
You can force a specific orientation using the
orientation prop.
Choose time view renderer
You can use the viewRenderers prop
to change the view that is used for rendering a
view. You might be interested in using the
Time Clock
instead of the
Digital Clock
on desktop as well as mobile.
Localization
See the Date format and localization and Translated components documentation pages for more details.
Validation
See the Validation documentation page for more details.
API
See the documentation below for a complete reference to all of the props and classes available to the components mentioned here.