Skip to content

BbTimePicker

Opens hour/minute(/second) columns in a popover on a trigger you own — the time analog of BbDatePicker; also the v-bb-time directive.

import { BbTimePicker } from 'bitboss-ui';

On this page

Props

NameDescription
activator Type: ElementOrComponentRef

External activator element or component ref. When provided, the activator slot is not rendered and click + ARIA are attached programmatically to the referenced element — mirroring BbDatePicker.

For a trigger that already exists elsewhere in your markup. A bare schedule cell with no slot state is shorter still with the v-bb-time directive.

See example
activeSegment Type: BbTimePickerSegment

Which end the columns edit in range mode (v-model:active-segment). Standalone use manages this internally via the in-panel toggle; a host can drive it. Ignored outside range.

adaptive Type: booleanDefaultconfig.adaptive (true)

On mobile, open in a bottom off-canvas sheet instead of a floating popover. When unset, falls back to the global config.adaptive.

Set it per instance only to disagree with the app-wide config.adaptive, or to false for viewport-independent tests. Desktop placement props do not apply to the sheet.

See example
ampm Type: booleanDefaultfalse

12-hour display with an AM/PM column; emitted values stay 24-hour.

Display only: the model still holds 24-hour text, so nothing downstream changes when you switch it on.

See example
anchor Type: ElementOrComponentRef

Element or component ref the popover positions itself relative to. Defaults to the activator when omitted (anchor to a larger row while a smaller element stays the click target).

boundary Type: ElementOrComponentRefOrSelector

Constrains the popover within a bounding element or CSS selector: sideways only, alongside the trigger; it flips at the viewport.

disabled Type: booleanDefaultfalse

Disables the activator and the columns.

disableFlip Type: booleanDefaultfalse

Disable the automatic flip to the opposite side on overflow.

eager Type: booleanDefaultfalse

Render popover content before it is first shown.

label Type: string

Accessible label. The activator is named by it followed by the activator's own text ("Due date 12 Sep"), through aria-labelledby.

Your trigger usually shows the time, not what it is for. Name the value here, such as "Monday opening time", so each picker in a schedule reads differently to a screen reader.

See example
max Type: string

Maximum selectable time, HH:mm (other shapes throw at setup). The columns disable the entries no in-range time can use; a typed value (or an hour beside an out-of-range minute) is clamped with a disabled_time error.

Later entries stay visible in the columns, disabled, the way the calendar shows days out of range.

See example
min Type: string

Minimum selectable time, HH:mm (other shapes throw at setup). The columns disable the entries no in-range time can use; a typed value (or an hour beside an out-of-range minute) is clamped with a disabled_time error.

Earlier entries stay visible in the columns, disabled, the way the calendar shows days out of range.

See example
modelValue requiredType: string | string[] | null

v-model value: null for empty, a 24-hour HH:mm (or HH:mm:ss with seconds) string, or a two-element [start, end] array when range is true.

offCanvasProps Type: Partial<BbOffCanvasProps>

Props for the phone sheet (the BbOffCanvas that adaptive renders on mobile), spread over its defaults. A pt inside it styles only the sheet (passthrough guide § Inside the sheet). The sheet hides its ✕; { hideClose: false } brings it back.

See example
offset Type: numberDefault4

Space the popover keeps from the activator.

padding Type: number

Minimum empty space to keep from the edge of the page.

placement Type: Placement

Position of the popover relative to the activator/anchor.

pt Type: PtMap<BbTimePickerPtPart, BbTimePickerPtState>

Passthrough, object form: the same keys as the pt:* attributes without the prefix. See the pt:<part> row.

pt:<part> Type: PtValue

Passthrough, attribute form: one attribute per part, pt:<part>, and per part and state, pt:<part>:<state>. Parts: cellColumnHeader, header, item, panel, root, sheet. States: disabled, open, selected.

See example
range Type: booleanDefaultfalse

Range selection: the value is a two-element [start, end] array.

Use [] as the empty model, not null. The pair is kept as picked, so an end before the start is a window across midnight; check the order yourself if yours cannot cross it.

See example
readonly Type: booleanDefaultfalse

Prevents opening while keeping the activator visible.

seconds Type: booleanDefaultfalse

Adds the seconds column.

See example
step Type: numberDefault1

Minute-column granularity and arrow stepping.

Limits what the columns offer without rounding a value that is already off the grid.

See example
transitionDuration Type: numberDefault250

Popover/sheet transition duration in milliseconds.

v-model

Values kept in sync through v-model.

NameDescription
activeSegment Type: BbTimePickerSegment

The in-panel toggle already manages it. Bind it only when another control has to read or switch the end being edited.

See example
modelValue Type: string | string[] | null

A wall-clock string with no date or timezone, so 09:00 means nine o'clock in every region. Attach a date before doing any instant arithmetic.

See example

Events

NameDescription
error Type: (error: TimePickerInputError): void

Emitted on every normalization (clamped time).

Only disabled_time: an hour picked next to a minute that is out of range for it is moved to the bound. The picker never reorders a range.

See example
hidden Type: (): void

Emitted once the time panel has finished closing.

hide Type: (): void

Emitted as soon as the time panel starts to close.

show Type: (): void

Emitted as soon as the time panel (the popover, or the sheet on a phone) starts to open.

shown Type: (): void

Emitted once the time panel is open and its open transition has finished.

time-pick Type: (payload: { unit: TimeUnit; value: string; }): void

Relay of the raw column pick, before this component combines it into the value. A host binds this to run its own engine; clean consumers ignore it.

update:activeSegment Type: (value: BbTimePickerSegment): void

The active range end changed (range only).

update:modelValue Type: (value: string | string[] | null): void

Emitted when the selected time changes (single/range/null).

Slots

The listed properties are the ones exposed to the slot scope.

NameDescription
activator Type: BbTimePickerActivatorSlotProps

Custom activator element. Apply v-bind="props" to your trigger.

Bind props to the clickable element: it carries the click handler, the anchor, the accessible name (aria-labelledby) and the open state.

See example