Description

Time pickers allow the user to either enter a time manually or set hours and minutes using up and down buttons.

Two time pickers can be used, for start and end times, to allow the user to enter a time range.

Usage & Behavior

General guidelines

Structure

Time pickers consist of:

Default

The time picker may have an initial value, which the user can edit at any time.

States

State

Visual

 

Regular

Time Picker - Regular.png

 

Hover

Time Picker - Hover.png

 

Active

Time Picker -  Active AM.pngTime Picker - Active minutes and seconds only.pngTime Picker -  Active PM.png

Time Picker - Active with seconds.png

Disabled

Time Picker - Disabled.png

 

Read-Only

Time Picker - Read only.png

Error

Time Picker - Error.png

 

Warning

Time Picker - Warning.png

 

Focused

Time Picker - Focused.pngTime Picker - Focused minutes.pngTime Picker - Focused seconds.pngTime picker - Focused AMPM.png

Focused, Hover

Time Picker - Focused Hover.png

 

Focused, Active

Time Picker - Focused Active.png

 

Focused, Disabled

Time Picker - Focused, Disabled.png

 

Interaction

The time can be set either via direct input or by using the controls in the time picker menu. Additional keyboard interactions can be found under the Focus management section below.

Direct input

Time picker menu

Validation and Errors

Please refer to Field validation page for more information.

A time field with a warning will have an orange border and a warning icon, as displayed below:

Validation warnings.png

A time field with an error will have a red border and an error icon, as displayed below:

Validations errors.png

Best practices

Use when:

Don’t use:

Accessibility Compliance

Unless otherwise specified, see our general compliance information in Fundamentals - Accessibility.

Focus management

Keyboard

Time picker field

Time picker menu

Time Picker - Focused.pngTime Picker - Focused minutes.png

Tab

  • Navigates to the next input section.

  • When on the last input section, navigates to the next component.

Navigates between the different sections in a cyclical order:

  • Hours.

  • Minutes.

  • AM/PM.

Shift + Tab

  • Navigates to the previous input section.

  • When on the first input section, navigates to the previous component.

Reverses the order of navigation described for Tab.

Space

Opens the time picker menu.

  • Hours - N/A

  • Minutes - N/A

  • AM/PM - toggles between the values.

Enter

Applies the time.

  • Applies the time.

  • Closes the menu.

Esc

N/A

Closes the menu and returns the focus to the field, without applying any changes.

Arrows

  • Up - Increases the highlighted value.

  • Down - Decreases the highlighted value.

  • Holding down the up/down keys will scroll continuously.

  • Right/Left - Moves the input highlight accordingly.

  • Up - Increases the highlighted value for the focused section.

  • Down - Decreases the highlighted value for the focused section.

  • Holding down the up/down keys will scroll continuously.

  • Right/Left - Moves the focused section accordingly.

  • Up/Down changes between AM/PM

Mouse

Time picker field

Time picker menu

Right Click

Set Focus state on field

Set Regular state on component

Design

Zeplin Link

Thumbnail

https://zpl.io/adOXdRV

Time picker states.png

Code