Time-picker component overview
Use a time picker when people need to set a time of day. To pick a date and a time together, pair it with a date picker. For a short list of fixed slots, such as three delivery windows, a select or radio group is clearer.
When to use
Use time pickers when
- People need to set a specific time of day, such as a meeting start or an alarm
- The time must follow local conventions, like segment order and AM/PM labels
- You need to limit times with business hours or fixed intervals
- Typing and picking should both be quick and error-free
Do not use time pickers when
- Only a handful of fixed time slots are available
- People need to enter a duration longer than a day
- The value is a relative time, like “in 2 hours”
- An approximate time of day, like “morning”, is enough
Patterns
Anatomy
Time-picker component anatomy
second precision, a 12-hour clock, and a prefix icon to show every part. Keep the label specific and let the locale decide the segment order and labels.
Design guidelines
1
Pick the right precision
Start with the default
minute precision. Use hour for coarse slots, such as opening hours, and second only when seconds matter, such as lap times or logs.2
Let the locale drive the format
Set
locale to the product locale, so segment order, separators, and AM/PM labels match what people expect. The clock is 24-hour by default; set hour-format="12" when people expect a 12-hour clock.3
Constrain the choices
Apply
min, max, and step values when business rules are known. Options outside the rules are disabled in the panel, and typed values are clamped when focus leaves the field.Use steps that divide evenly into the unit, such as 5, 10, 15, or 30 minutes, so the options stay predictable and easy to scan.
Usage
Default
Use the default configuration when people need to set an hour and minute. Click the field or the clock icon to open the panel, or type the time directly.The
value attribute, min, and max always use a 24-hour wire format, whatever the display: HH:mm at minute precision, HH:00 at hour precision, and HH:mm:ss at second precision.A locale-derived format hint, such as hh:mm, shows the expected layout before entry starts. On focus, one segment is active. Type digits to replace that segment, use ArrowLeft and ArrowRight to move, Home and End to reach the first or last segment, ArrowUp and ArrowDown to change a value, and Backspace or Delete to clear a segment. For AM/PM, type A or P. Paste is not supported.Options
Precision
Useprecision to choose the smallest unit people edit and submit. The field and the panel only show the matching segments and columns. At hour precision on a 24-hour clock, the panel adds a disabled minute column fixed at 00, so it reads as a time.
12-hour and 24-hour clock
The clock is 24-hour by default, whatever thelocale. Set hour-format="12" for a 12-hour clock with an AM/PM segment. The submitted value stays in 24-hour format.
Locale
Uselocale to set the segment order, separators, AM/PM labels, and column headers. Some locales place the period before the hour, and the panel columns follow the same order. The examples set hour-format="12" where the locale usually shows a 12-hour clock.
Labels
Uselabels to change the column headers, AM/PM labels, button text, and accessible names, for example to translate them. Pass an object, or a JSON string through the HTML attribute. Every key is optional: hour, minute, second, am, and pm default to the locale names, period defaults to the AM and PM labels joined by a slash, and the rest default to English.
Minimum and maximum time
Usemin and max to set the earliest and latest selectable times. Options outside the range are disabled in the panel, and the “Now” button is disabled when the current time is out of range. If min is later than max, both are ignored.
Steps
Usehour-step, minute-step, and second-step to show options at fixed intervals. Typed values that fall between steps are kept but flagged as invalid, and “Now” rounds down to the nearest step.
Require confirmation
Withrequire-confirm, panel picks, including “Now”, stay a draft until people press OK or Enter. Escape, an outside click, or moving focus away discards the draft. Values typed in the field are always committed right away.
Without the Now button
Setdisable-now to hide the “Now” button when the current time isn’t a meaningful choice, such as for reminders set for later in the day. The OK button is always shown.
Prefix and suffix
Use theprefix slot to add context before the value. The suffix slot replaces the clock icon inside the trigger button, so set labels.openPanel to keep the button name accurate.
Without the clear button
Setdisable-clear to hide the clear button when the field should always hold a value.
Disabled and read-only
Usedisabled when the time isn’t available for editing and shouldn’t be submitted. Use readonly when people should see and submit the value but not change it: the segments stay focusable, and the panel doesn’t open.
Validation states
Usevalidation-status when the field should show immediate visual feedback after validation.
Form integration
bq-time-picker submits its current value with the form, in 24-hour format. Use required and form-validation-message when the time is mandatory; the custom message also applies to incomplete, out-of-range, and off-step values.
When focus leaves the field, complete times outside min or max are clamped to the nearest bound. A disabled time picker is excluded from form data; a read-only one is still submitted.
Best practices
DoWrite labels that name the moment, such as “Departure time” or “Meeting starts”, so people know which time they are setting.
Don’tDo not rely on the format hint alone to explain the field. Always provide a visible label.
DoMatch
precision to the task. Most scheduling needs hours and minutes only; add seconds only for durations or precise logs.Don’tDo not ask for seconds when nobody will use them. Every extra segment adds typing and scanning effort.
DoSet
min, max, and step values when business rules are known, so unavailable times are disabled before people pick them.Don’tDo not mix clocks across a product. Pick the
hour-format your audience expects and use it for every time picker.DoUse
require-confirm when a picked time triggers an expensive or irreversible action, such as rescheduling a booking.Don’tDo not use a time picker for durations longer than a day or for picking a date and time together.
Accessibility
bq-time-pickeris form-associated and delegates focus, so it participates in native forms and moves focus into its segmented field when the component receives focus.- The segmented field is a labelled
groupdescribed by the expected format and, when a constraint fails, by the validation message. Each hour, minute, second, and AM/PM control is aspinbuttonwith its own label, limits, value text, and roving tabindex, and exposesaria-requiredwhen the field is required. - Each segment sets
aria-invalid="true"forvalidationStatus="error"and native constraint failures, such as a missing required value or an incomplete, out-of-range, or off-step time.aria-readonlyandaria-disabledreflect thereadonlyanddisabledstates. - The panel carries
role="dialog"and is named bylabels.panelLabel(“Choose time” by default). The panel isn’t modal. - Each column is a
listboxlabelled by its visible header (aria-labelledby), so the spoken name matches what people see. Options exposearia-selected, and options outsidemin,max, or the steps exposearia-disabled="true". - The component announces the selected time, or that no time is selected, when focus enters the field.
- Press
Alt+ArrowDownin the field, or Tab to the clock icon and pressEnterorSpace, to open the panel and move focus into it. Clicking the field opens the panel while keeping focus on the segment. - In the panel,
ArrowUpandArrowDownmove between options,HomeandEndjump to the first or last option,PageUpandPageDownmove faster, andArrowLeftandArrowRightswitch columns.EnterorSpacepicks an option, andEscapecloses the panel and returns focus to the field. - In
readonlymode the segments stay focusable so screen reader users can read the value, but they can’t be edited and the panel doesn’t open. - Always provide a visible label through the
labelslot, so the field has a programmatic name. - When you translate the interface, translate
labelstoo: segment names, button names and the panel name come from it. - Validation states should never rely on color alone. Pair
validationStatuswith visible error text so screen reader users receive the same feedback as sighted users.
API reference
Properties
Events
- In React, prefix events with
on:onBqBlur,onBqChange,onBqClear,onBqFocus. - In Angular, use the event binding syntax:
(bqBlur),(bqChange),(bqClear),(bqFocus). - In Vue, use the
@shorthand:@bqBlur,@bqChange,@bqClear,@bqFocus.
Methods
Slots
Shadow parts
CSS custom properties
Resources
Interactive playground
Explore time picker variants, constraints, locales, and panel behavior in Storybook.
Source code
Browse the component implementation, styles, and tests on GitHub.