Skip to main content

Time Picker

Rocket 2.0

The Time Picker component lets the user pick a time of day from a dropdown, such as a meeting start, a delivery window or a shift time.

Properties​

Property
Description
Expected Value
LabelText shown above the field.Text. Default: Time
Help textHint text shown under the field.Text
PlaceholderText shown in the field when no time is picked.Text. Default: Pick a time
Default value (HH:mm)Time picked when the app loads, in 24-hour HH:mm form, such as 14:30.Text
Time formatWhether times show on a 12-hour clock with AM and PM, or a 24-hour clock.12h, 24h. Default: 12h
PickerColumns shows separate hour and minute columns; List shows one scrolling list of times.Columns, List. Default: Columns
Minute stepGap in minutes between the times offered, such as 15 for quarter hours.Number. Default: 15
Earliest time (HH:mm)Earliest time the user can pick, in HH:mm form. An earlier time shows an error.Text
Latest time (HH:mm)Latest time the user can pick, in HH:mm form. A later time shows an error.Text
Show clear buttonShows a button in the field that clears the time.On or off. Default: Off

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off
Dynamic heightLets the component grow with its content in the running app instead of keeping a fixed height.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On selectTriggers when the picked time changes.
On focusTriggers when the field gets focus.
On blurTriggers when the field loses focus.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set valueSets the time to the given Value. Give a Format, such as hh:mm A, when the value isn't in HH:mm form.components.timepicker1.setValue("", "")
Clear valueClears the picked time.components.timepicker1.clearValue()
Set min timeChanges the earliest time the user can pick.components.timepicker1.setMinTime("")
Set max timeChanges the latest time the user can pick.components.timepicker1.setMaxTime("")
Set focusMoves keyboard focus to the field.components.timepicker1.setFocus()
Set blurCloses the picker and removes focus from the field.components.timepicker1.setBlur()
Set visibilityShows the component when true, hides it when false.components.timepicker1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.timepicker1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.timepicker1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
labelText shown above the field.{{components.timepicker1.label}}
descriptionHint text shown under the field.{{components.timepicker1.description}}
placeholderText shown in the field when no time is picked.{{components.timepicker1.placeholder}}
defaultValueTime picked when the app loads, in 24-hour HH:mm form, such as 14:30.{{components.timepicker1.defaultValue}}
timeFormatWhether times show on a 12-hour clock with AM and PM, or a 24-hour clock.{{components.timepicker1.timeFormat}}
pickerStyleColumns shows separate hour and minute columns; List shows one scrolling list of times.{{components.timepicker1.pickerStyle}}
minuteStepGap in minutes between the times offered, such as 15 for quarter hours.{{components.timepicker1.minuteStep}}
minTimeEarliest time the user can pick, in HH:mm form. An earlier time shows an error.{{components.timepicker1.minTime}}
maxTimeLatest time the user can pick, in HH:mm form. A later time shows an error.{{components.timepicker1.maxTime}}
showClearBtnShows a button in the field that clears the time.{{components.timepicker1.showClearBtn}}
valueThe picked time in 24-hour HH:mm form, such as 14:30.{{components.timepicker1.value}}
formattedValueThe picked time as the field shows it, such as 2:30 PM.{{components.timepicker1.formattedValue}}
isVisibleWhether the component is visible.{{components.timepicker1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.timepicker1.isLoading}}
isDisabledWhether the component is disabled.{{components.timepicker1.isDisabled}}

Styles​

Style
Default
Label colorTheme: Primary text
Help text colorTheme: Placeholder text
Field backgroundTheme: Surface 1
Field text colorTheme: Primary text
Placeholder colorTheme: Placeholder text
Field border colorTheme: Default border
Accent (focus ring, selection)Theme: Brand primary
Error color (message and border)Theme: Error
Field radius—
Clock icon colorTheme: Primary text
Popover backgroundTheme: Surface 1
Popover text colorTheme: Primary text
Popover item hover backgroundTheme: Surface 3
Selected item text color (on the accent)Theme: Surface 1
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.