Skip to content

Time Picker

Time Picker let the user select a time.

The selected time is indicated by the filled circle at the end of the clock hand.

Basic usage

The Time Picker is rendered as a modal dialog on mobile, and in the field on desktop.

Press Enter to start editing

Component composition

The Time Picker components are built using the TimeField for the keyboard editing and the TimeClock for the view editing. All the documented props of those two components can also be passed to the Time Picker components.

Check-out their documentation page for more information:

Uncontrolled vs. Controlled

The component can be uncontrolled or controlled

Press Enter to start editing

Responsiveness

The Time picker Component is designed and optimized for the device it runs on.

  • The MobileNextTimePicker component works best for touch devices and small screens.
  • The DesktopNextTimePicker component works best for mouse devices and large screens.

By default, the NextTimePicker component renders the desktop version if the media query @media (pointer: fine) matches. This can be customized with the desktopModeMediaQuery prop.

There are certain caveats when testing pickers, please refer to this section for more information.

Press Enter to start editing

Static mode

It is also possible to render any Time Picker without the modal/popover and text field. This will enable building custom popover/modal containers.

Select time
:
123456789101112
Press Enter to start editing

Form props

The Time Picker component can be disabled or read-only.

Press Enter to start editing

Views

The component can contain three views: hours, minutes, and seconds. By default, only the hours and minutes views are enabled.

You can customize the enabled views using the views prop. Views will appear in the order they're included in the views array.

Press Enter to start editing

Landscape orientation

By default, the Time Picker automatically sets the orientation based on the window.orientation value.

You can force a specific orientation using the orientation prop.

Select time
:
123456789101112
Press Enter to start editing

Validation

You can find the documentation in the Validation page

API

See the documentation below for a complete reference to all of the props and classes available to the components mentioned here.