Learn about visual thememore

Timepicker

The timepicker module creates a SKY UX-themed input field and picker for users to enter or select times. Timepickers must be wrapped in input boxes to provide styling, ordering, and positioning within forms.

Demo

Link for section titled Usage
Usage

Use when

Use timepickers when users need to specify the time of day.

undefined
Do use timepickers when users specify times in 12-hour or 24-hour formats.

Use two timepickers when users need to specify start and stop times.

undefined
Do use two timepickers when users specify time ranges with start and stop times.

Don't use when

Don't use timepickers when users need to specify general durations or time spans. Use radio buttons or HTML select fields instead.

undefined
Don't use timepickers when users specify hours and minutes as lengths of time.
undefined
Do use radio buttons or HTML select fields when users specify durations or time spans.

Link for section titled Anatomy
Anatomy

1
Label
2
Picker button
3
Input field
4
Picker
5
Required field marker  (optional)
6
Help inline button  (optional)
7
Hint text  (optional)
image

Link for section titled Options
Options

12-hour timepicker

Use the 12-hour option for regions and users that use 12-hour time designations. This allows users to select hours, minutes, and "AM" or "PM."

undefined

24-hour timepicker

Use the 24-hour option for regions and users that use 24-hour time designations. This allows users to select hours and minutes.

undefined

Required field marker

When a timepicker is required, a red asterisk appears to the right of the label. It includes the appropriate ARIA attributes to support users of assistive technologies. For more information about required fields, see the form design guidelines.

Help inline button

When you need to supplement a timepicker label with additional information but don't require persistent inline help, you can place a help inline button beside the label to invoke contextual user assistance.

Hint text

To highlight important considerations about a timepicker, use hint text. This persistent inline help can explain details such as:

  • The correct format
  • Any constraints on the input
  • Additional instructions or context, such as how data is used

Stacked margin

For consistent vertical spacing when a timepicker is immediately followed by another form input, use stacked to add a bottom margin that visually separates the timepicker from the form input under it. For more information about spacing on forms, see the form layout guidelines.

Don't use stacked when the timepicker:

  • Is the last input before a field group
  • Is the last input on a form
  • Is followed by one or more conditional fields (use sky-margin-stacked-sm instead for closely related fields)
undefined

Link for section titled Behavior and states
Behavior and states

Keyboard entries

Users can use the keyboard to enter time values in the input field. Times automatically resolve to the correct format when the field loses focus.

Link for section titled Layout
Layout

Use 1/2- or 1/3-width columns for individual timepicker fields inside modals, except when using small (300px) modals. When using two timepickers for start and stop times, use 10px of horizontal space between them.

Link for section titled Related information
Related information

Components

Guidelines