Skip to content

BbDatePicker

Opens an anchored calendar (and optional time rail) popover on a trigger you own — the date analog of BbColorPalette; also the v-bb-date directive.

import { BbDatePicker } from 'bitboss-ui';

On this page

Props

NameTypeDefaultDescription
activatorElementOrComponentRef | undefined-

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 the BbColorPalette activator API.

activeSegmentBbCalendarSegment | undefined-

Which end the time rail edits in range + type="datetime" (v-model:active-segment). Standalone use manages this internally; an embedding host (the date input) drives it from its focused field. Ignored outside range + datetime.

adaptiveboolean | undefined`config.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.

ampmboolean | undefinedfalse

12-hour display with an AM/PM column (requires type="datetime"); emits stay 24h.

anchorElementOrComponentRef | undefined-

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).

boundaryElementOrComponentRefOrSelector | undefined-

Constrains the popover within a bounding element or CSS selector.

disabledboolean | undefinedfalse

Disables the activator and the calendar.

disableFlipboolean | undefinedfalse

Disable the automatic flip to the opposite side on overflow.

eagerboolean | undefinedfalse

Render popover content before it is first shown.

firstDayOfWeek0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined1

First day of the week (0 = Sunday … 6 = Saturday).

floatingboolean | undefinedfalse

Emit plain calendar strings instead of zoned ISO instants. Implied (and forced) by type="month" and type="year".

labelstring | undefined-

Accessible label applied to the activator via aria-label.

maxstring | undefined-

Maximum selectable value, in this type's shape. A finer bound is accepted and ceiled to the unit, with a warning.

minstring | undefined-

Minimum selectable value, in this type's shape — YYYY-MM-DD (YYYY-MM-DDTHH:mm with datetime, YYYY-MM with month, YYYY with year). A finer bound is accepted and floored to the unit, with a warning.

modelValuerequiredstring | string[] | null-

v-model value. null for empty, a single string for single selection, or a two-element [start, end] array when range is true. The string shape follows type: YYYY-MM-DD when floating (YYYY-MM for month, YYYY for year), otherwise a zoned ISO instant carrying the time inline with type="datetime".

multipleboolean | undefinedfalse

Enables multi-selection: every pick toggles a value in or out of a sorted array, and the panel stays open until it is dismissed. Works in whatever type selects — days, months or years — and requires an array modelValue (use [] for empty, never null). Mutually exclusive with range (two different selection models) and with type="datetime" (the time rail edits one value; with several there is no one it could mean). Both combinations throw.

offCanvasPropsPartial<BbOffCanvasProps> | undefined-

Props for the phone sheet. A pt inside it, object or colon keys, styles only that sheet. Extra props forwarded to the BbOffCanvas sheet when adaptive is active on mobile (e.g. title, size, persistent). Spread over the defaults: the sheet is draggable (the time wheels and the year list never drag it) and hides its ✕ (picking, backdrop, Escape and drag close it); pass { hideClose: false } to bring the ✕ back. A pt inside it styles ONLY the sheet, in BbOffCanvas's part words (root, header, title, description, content, footer, close; state open), object ({ pt: { header: '…' } }) or colon keys ({ 'pt:header': '…' }) alike. It merges after what this component forwards to its sheet, so it wins a conflict and drops nothing — see the passthrough guide § Inside the sheet. For this component it is the only way to style the sheet's header, title and ✕: its own pt:header is the calendar's navigation bar.

offsetnumber | undefined4

Space the popover keeps from the activator.

paddingnumber | undefined-

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

placementPlacement | undefined-

Position of the popover relative to the activator/anchor.

ptPtMap<BbDatePickerPtPart, BbDatePickerPtState> | undefined-

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

pt:arrowPtValue | undefined-
pt:arrow:activePtValue | undefined-
pt:arrow:disabledPtValue | undefined-
pt:arrow:highlightedPtValue | undefined-
pt:arrow:in-rangePtValue | undefined-
pt:arrow:openPtValue | undefined-
pt:arrow:outsidePtValue | undefined-
pt:arrow:range-endPtValue | undefined-
pt:arrow:range-startPtValue | undefined-
pt:arrow:selectedPtValue | undefined-
pt:arrow:todayPtValue | undefined-
pt:column-headerPtValue | undefined-
pt:column-header:activePtValue | undefined-
pt:column-header:disabledPtValue | undefined-
pt:column-header:highlightedPtValue | undefined-
pt:column-header:in-rangePtValue | undefined-
pt:column-header:openPtValue | undefined-
pt:column-header:outsidePtValue | undefined-
pt:column-header:range-endPtValue | undefined-
pt:column-header:range-startPtValue | undefined-
pt:column-header:selectedPtValue | undefined-
pt:column-header:todayPtValue | undefined-
pt:dayPtValue | undefined-
pt:day-buttonPtValue | undefined-
pt:day-button:activePtValue | undefined-
pt:day-button:disabledPtValue | undefined-
pt:day-button:highlightedPtValue | undefined-
pt:day-button:in-rangePtValue | undefined-
pt:day-button:openPtValue | undefined-
pt:day-button:outsidePtValue | undefined-
pt:day-button:range-endPtValue | undefined-
pt:day-button:range-startPtValue | undefined-
pt:day-button:selectedPtValue | undefined-
pt:day-button:todayPtValue | undefined-
pt:day:activePtValue | undefined-
pt:day:disabledPtValue | undefined-
pt:day:highlightedPtValue | undefined-
pt:day:in-rangePtValue | undefined-
pt:day:openPtValue | undefined-
pt:day:outsidePtValue | undefined-
pt:day:range-endPtValue | undefined-
pt:day:range-startPtValue | undefined-
pt:day:selectedPtValue | undefined-
pt:day:todayPtValue | undefined-
pt:headerPtValue | undefined-
pt:header:activePtValue | undefined-
pt:header:disabledPtValue | undefined-
pt:header:highlightedPtValue | undefined-
pt:header:in-rangePtValue | undefined-
pt:header:openPtValue | undefined-
pt:header:outsidePtValue | undefined-
pt:header:range-endPtValue | undefined-
pt:header:range-startPtValue | undefined-
pt:header:selectedPtValue | undefined-
pt:header:todayPtValue | undefined-
pt:monthPtValue | undefined-
pt:month-itemPtValue | undefined-
pt:month-item:activePtValue | undefined-
pt:month-item:disabledPtValue | undefined-
pt:month-item:highlightedPtValue | undefined-
pt:month-item:in-rangePtValue | undefined-
pt:month-item:openPtValue | undefined-
pt:month-item:outsidePtValue | undefined-
pt:month-item:range-endPtValue | undefined-
pt:month-item:range-startPtValue | undefined-
pt:month-item:selectedPtValue | undefined-
pt:month-item:todayPtValue | undefined-
pt:month:activePtValue | undefined-
pt:month:disabledPtValue | undefined-
pt:month:highlightedPtValue | undefined-
pt:month:in-rangePtValue | undefined-
pt:month:openPtValue | undefined-
pt:month:outsidePtValue | undefined-
pt:month:range-endPtValue | undefined-
pt:month:range-startPtValue | undefined-
pt:month:selectedPtValue | undefined-
pt:month:todayPtValue | undefined-
pt:panelPtValue | undefined-
pt:panel:activePtValue | undefined-
pt:panel:disabledPtValue | undefined-
pt:panel:highlightedPtValue | undefined-
pt:panel:in-rangePtValue | undefined-
pt:panel:openPtValue | undefined-
pt:panel:outsidePtValue | undefined-
pt:panel:range-endPtValue | undefined-
pt:panel:range-startPtValue | undefined-
pt:panel:selectedPtValue | undefined-
pt:panel:todayPtValue | undefined-
pt:rootPtValue | undefined-
pt:root:activePtValue | undefined-
pt:root:disabledPtValue | undefined-
pt:root:highlightedPtValue | undefined-
pt:root:in-rangePtValue | undefined-
pt:root:openPtValue | undefined-
pt:root:outsidePtValue | undefined-
pt:root:range-endPtValue | undefined-
pt:root:range-startPtValue | undefined-
pt:root:selectedPtValue | undefined-
pt:root:todayPtValue | undefined-
pt:sheetPtValue | undefined-
pt:sheet:activePtValue | undefined-
pt:sheet:disabledPtValue | undefined-
pt:sheet:highlightedPtValue | undefined-
pt:sheet:in-rangePtValue | undefined-
pt:sheet:openPtValue | undefined-
pt:sheet:outsidePtValue | undefined-
pt:sheet:range-endPtValue | undefined-
pt:sheet:range-startPtValue | undefined-
pt:sheet:selectedPtValue | undefined-
pt:sheet:todayPtValue | undefined-
pt:yearPtValue | undefined-
pt:year-itemPtValue | undefined-
pt:year-item:activePtValue | undefined-
pt:year-item:disabledPtValue | undefined-
pt:year-item:highlightedPtValue | undefined-
pt:year-item:in-rangePtValue | undefined-
pt:year-item:openPtValue | undefined-
pt:year-item:outsidePtValue | undefined-
pt:year-item:range-endPtValue | undefined-
pt:year-item:range-startPtValue | undefined-
pt:year-item:selectedPtValue | undefined-
pt:year-item:todayPtValue | undefined-
pt:year:activePtValue | undefined-
pt:year:disabledPtValue | undefined-
pt:year:highlightedPtValue | undefined-
pt:year:in-rangePtValue | undefined-
pt:year:openPtValue | undefined-
pt:year:outsidePtValue | undefined-
pt:year:range-endPtValue | undefined-
pt:year:range-startPtValue | undefined-
pt:year:selectedPtValue | undefined-
pt:year:todayPtValue | undefined-
rangeboolean | undefinedfalse

Enables range selection ([start, end]).

readonlyboolean | undefinedfalse

Prevents opening while keeping the activator visible.

secondsboolean | undefinedfalse

Adds the seconds column (requires type="datetime").

selectable((date: string) => boolean) | undefined-

Predicate invoked per candidate; return false to disable it. Receives the value in this type's shape — YYYY-MM under month, YYYY under year.

stepnumber | undefined1

Minute-column granularity and arrow stepping (requires type="datetime").

timestring | string[] | null | undefined-

Companion time model (v-model:time), 24-hour HH:mm / HH:mm:ss. With floating it is the only carrier of the time; otherwise it mirrors the time inside modelValue. Requires type="datetime".

transitionDurationnumber | undefined250

Popover/sheet transition duration in milliseconds.

typeDatePickerType | undefined"date"

What the picker selects, and therefore what it emits. - date (default) — a day. - datetime — a day plus a time rail beside the calendar. Non-floating values carry the time inside modelValue; with floating the time travels only through time. - month — a month grid emitting YYYY-MM. - year — a year list emitting YYYY. month/year are calendar labels, not instants: they force floating and ignore utc, and the time props (seconds, ampm, step, time) are inert outside datetime.

utcboolean | undefinedfalse

Emit UTC (...Z) instead of the local offset. Ignored with floating, and therefore with type="month"/type="year".

v-model

Values kept in sync through v-model.

NameTypeDescription
activeSegmentBbCalendarSegment | undefined
modelValuestring | string[] | null
timestring | string[] | null | undefined

Events

NameTypeDescription
grid-pick(event: "grid-pick", value: string | string[] | null): void
hidden(event: "hidden"): void
hide(event: "hide"): void
show(event: "show"): void
shown(event: "shown"): void
time-pick(event: "time-pick", payload: { unit: TimeUnit; value: string; }): void
update:activeSegment(event: "update:activeSegment", value: BbCalendarSegment): void
update:modelValue(event: "update:modelValue", value: string | string[] | null): void
update:time(event: "update:time", value: string | string[] | null): void

Slots

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

NameTypeDescription
<YYYY_MM_DD>BbCalendarDaySlotProps

One date's button label (e.g. #2024_03_15: the local YYYY-MM-DD through slotKey); beats day. Day grid only.

activatorBbDatePickerActivatorSlotProps

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

append:<YYYY_MM_DD>BbCalendarDaySlotProps

Content under one date's cell; beats append:day.

append:dayBbCalendarDaySlotProps

Appends content below each calendar day.

dayBbCalendarDaySlotProps

Replaces the day button label inside each calendar day.

Changes from v2

Props removed or renamed in 3.0. If you are coming from v2, the answer is here.

  • datetimetypefails silently