Skip to content

BbTimePickerInput

Enter a recurring wall-clock time or schedule window in a labelled segmented field.

import { BbTimePickerInput } from 'bitboss-ui';

On this page

Use it for

Use BbTimePickerInput for a recurring time with no date, such as support hours, a shift boundary, or a daily dispatch.

Use something else when

  • BbTimePicker: the time is assigned from your own cell, chip, or button
  • BbDatePickerInput with type="datetime": the time belongs to a specific calendar date

Also see: Validated forms.

Passthrough

Hover or tap a part to outline it. The toggles turn on loading, errors and warnings where the component has them; only parts get a row.

Guidance while the control is focused.

Set support hours

Give each opening and closing time its own labelled field; each submits a 24-hour value.

Support hours

Submitted: weekdays: 09:00–18:00, saturday: 10:00–14:00, sunday: closed

Pass a stable id and name; label does not supply the native name, and inside a BbForm name is the field's key. The separate hour and minute inputs auto-advance, accept pasted times, and support arrow-key stepping.

A field joined to a BbForm by its name is required through rules="required" or the schema. required inside a form is a hint that marks the field and checks nothing, and the asterisk follows a rule too (Validated forms). Add formless to keep a field that sits inside a form out of its data.

Wall-clock semantics

The model is null or a zero-padded 24-hour string such as 09:00. It contains no date or timezone, so the same stored value means nine o'clock in every region.

Model
"09:30"

Do not parse the value with new Date('09:00'). Attach the relevant date before doing instant or timezone arithmetic. With ampm the field displays the 12-hour form in the locale's words (09:30 AM), and the model stays 24-hour, as the readout under the demo shows: there is nothing to format yourself.

Display and granularity

Use ampm for a 12-hour field, seconds for HH:mm:ss, and step for the minute rows offered by the columns.

ampm + step 15 → 14:30
seconds → 14:30:45
step 15, value 10:07 — accepted, and no column row highlights for it

step constrains column picks, not typing. An off-grid typed value remains unchanged and highlights no row.

Bounds and ranges

Use min and max to constrain a callback window. The columns disable the times outside it; a typed one is clamped on commit and reported through error.

We call between 09:00 and 18:00.

Type 07:00 and leave the field: it snaps to 09:00 and says so.

Use range for a shift and keep the model as an array.

["08:00","16:00"]

Type 16:00 then 08:00 and leave the field: the pair swaps.

Seed and clear it with []. A reversed range is swapped on commit and emits end_before_start, so the field cannot hold a window that crosses midnight: use BbTimePicker for a night shift. Turn error payloads into application messages through errors; clear them on active.

Typing and mobile

Use disable-writing="mobile" when touch users should choose from the columns while desktop users keep keyboard entry.

adaptive opens the columns in a bottom sheet on mobile. Pass sheet options through offCanvasProps, or set :adaptive="false" for viewport-independent tests. Shared label, message, state, and form props follow BbTextInput.

variant="none" drops every colour, focus ring included, for a field you style yourself, like the flat search field on BbTextInput.

Coming from v2has-warning → has-warnings

The shared v2 input prop hasWarning is now hasWarnings.