Skip to content

BbDatePicker

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

import { BbDatePicker } 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 the BbColorPicker activator API.

For an element you already hold a ref to. For a bare table cell that needs no slot state, the v-bb-date directive is lighter.

See example
activeSegment Type: BbCalendarSegment

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.

adaptive Type: booleanDefaultall.adaptive (true)

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

Inherited from the plugin's components.all.adaptive, which defaults to true. Set :adaptive="false" for a popover on every viewport, including in viewport-independent tests.

See example
ampm Type: booleanDefaultfalse

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

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.

clearable Type: booleanDefaultfalse

Clicking the selected date (week, month, year) again clears a single value. Off: re-picking keeps it. multiple and range ignore it.

Without it, picking the selected date again keeps it, which suits a required choice.

See example
disabled Type: booleanDefaultfalse

Disables the activator and the calendar.

disableFlip Type: booleanDefaultfalse

Disable the automatic flip to the opposite side on overflow.

eager Type: booleanDefaultfalse

Render popover content before it is first shown.

firstDayOfWeek Type: 0 | 1 | 2 | 3 | 4 | 5 | 6Defaultthe locale's week start

First day of the week (0 = Sunday … 6 = Saturday). Omitted, the active locale's week start: Monday for it, de, fr, en-gb…, Sunday for bare en (US) and pt (Brazil). Ignored under type="week": ISO weeks run Monday to Sunday, so a week grid always starts on Monday.

floating Type: booleanDefaultfalse

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

Use it for due dates, birthdays and report filters: a calendar day that must read the same in every timezone. Leave it off when the value is an instant.

See example
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.

Make it specific, “Due date for Lindqvist Studio” rather than “Date”, and keep the value visible on the trigger: both are read out together.

See example
max Type: string

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

With type="datetime", add a time (2026-10-31T18:00) when the bound is a moment: on that day the time rail disables the later times.

See example
min Type: string

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 week or a date with week, whole weeks only). A finer bound is accepted and floored to the unit, with a warning.

With type="datetime", add a time (2026-08-30T14:00) when the bound is a moment: on that day the time rail disables the earlier times.

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

v-model: null when empty, a string, a [start, end] pair with range, or a sorted array with multiple. The string is YYYY-MM-DD when floating (YYYY-Www / YYYY-MM / YYYY for week / month / year), otherwise a zoned ISO instant (carrying the time under datetime).

month Type: string

The month on screen (v-model:month), as on BbCalendar: the ISO date of its first day ('2026-11-01'). The panel opens on a month the app writes and writes nothing back; paging emits the new view's first day.

multiple Type: booleanDefaultfalse

Multi-selection: each pick toggles a value in a sorted array (days, weeks, months or years), and the panel stays open until dismissed. Needs an array modelValue ([] when empty, never null). Throws with range or type="datetime".

See example
numberOfMonths Type: numberDefault1

How many months the popover shows side by side (day grids only); the phone sheet always shows one. Too narrow for them all, the months wrap.

The phone sheet always shows one month.

See example
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.

open Type: booleanDefaultfalse

Whether the panel is open (v-model:open; v-model stays the value). Bound, the app opens and closes it; unbound, the initial state.

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: (PtCompoundOf<"", { readonly parts: readonly ["root", "panel", "sheet", "header", "arrow", "month", "year", "cellColumnHeader", "week", "weekNumber", "day", "dayButton", "monthItem", "yearItem", "item"]; readonly states: readonly ["outside", "today", "inRange", "selected", "rangeStart", "rangeEnd", "disabled", "active", "open", "highlighted"]; readonly wide: readonly ["disabled", "open"]; readonly node: { readonly week: readonly ["inRange", "selected", "rangeStart", "rangeEnd"]; readonly weekNumber: readonly ["inRange", "selected", "rangeStart", "rangeEnd"]; readonly day: readonly ["outside", "today", "inRange", "selected", "rangeStart", "rangeEnd", "highlighted"]; readonly dayButton: readonly ["outside", "today", "inRange", "selected", "rangeStart", "rangeEnd", "highlighted"]; readonly monthItem: readonly ["inRange", "selected", "rangeStart", "rangeEnd", "highlighted"]; readonly yearItem: readonly ["inRange", "selected", "rangeStart", "rangeEnd", "highlighted"]; readonly month: readonly ["active"]; readonly year: readonly ["active"]; readonly item: readonly ["selected"]; }; }> & { header?: PtValue | undefined; root?: PtValue | undefined; panel?: PtValue | undefined; "header:disabled"?: PtValue | undefined; "header:open"?: PtValue | undefined; "root:disabled"?: PtValue | undefined; "root:open"?: PtValue | undefined; "panel:disabled"?: PtValue | undefined; "panel:open"?: PtValue | undefined; item?: PtValue | undefined; "item:disabled"?: PtValue | undefined; arrow?: PtValue | undefined; month?: PtValue | undefined; year?: PtValue | undefined; cellColumnHeader?: PtValue | undefined; week?: PtValue | undefined; weekNumber?: PtValue | undefined; day?: PtValue | undefined; dayButton?: PtValue | undefined; monthItem?: PtValue | undefined; yearItem?: PtValue | undefined; "arrow:disabled"?: PtValue | undefined; "month:disabled"?: PtValue | undefined; "year:disabled"?: PtValue | undefined; "cellColumnHeader:disabled"?: PtValue | undefined; "week:disabled"?: PtValue | undefined; "weekNumber:disabled"?: PtValue | undefined; "day:disabled"?: PtValue | undefined; "dayButton:disabled"?: PtValue | undefined; "monthItem:disabled"?: PtValue | undefined; "yearItem:disabled"?: PtValue | undefined; "item:selected"?: PtValue | undefined; "month:active"?: PtValue | undefined; "year:active"?: PtValue | undefined; "week:inRange"?: PtValue | undefined; "week:selected"?: PtValue | undefined; "week:rangeStart"?: PtValue | undefined; "week:rangeEnd"?: PtValue | undefined; "weekNumber:inRange"?: PtValue | undefined; "weekNumber:selected"?: PtValue | undefined; "weekNumber:rangeStart"?: PtValue | undefined; "weekNumber:rangeEnd"?: PtValue | undefined; "day:outside"?: PtValue | undefined; "day:today"?: PtValue | undefined; "day:inRange"?: PtValue | undefined; "day:selected"?: PtValue | undefined; "day:rangeStart"?: PtValue | undefined; "day:rangeEnd"?: PtValue | undefined; "day:highlighted"?: PtValue | undefined; "dayButton:outside"?: PtValue | undefined; "dayButton:today"?: PtValue | undefined; "dayButton:inRange"?: PtValue | undefined; "dayButton:selected"?: PtValue | undefined; "dayButton:rangeStart"?: PtValue | undefined; "dayButton:rangeEnd"?: PtValue | undefined; "dayButton:highlighted"?: PtValue | undefined; "monthItem:inRange"?: PtValue | undefined; "monthItem:selected"?: PtValue | undefined; "monthItem:rangeStart"?: PtValue | undefined; "monthItem:rangeEnd"?: PtValue | undefined; "monthItem:highlighted"?: PtValue | undefined; "yearItem:inRange"?: PtValue | undefined; "yearItem:selected"?: PtValue | undefined; "yearItem:rangeStart"?: PtValue | undefined; "yearItem:rangeEnd"?: PtValue | undefined; "yearItem:highlighted"?: PtValue | undefined; sheet?: PtValue | undefined; "sheet:open"?: PtValue | undefined; "sheet:disabled"?: PtValue | undefined; "item:open"?: PtValue | undefined; "arrow:open"?: PtValue | undefined; "month:open"?: PtValue | undefined; "year:open"?: PtValue | undefined; "cellColumnHeader:open"?: PtValue | undefined; "week:open"?: PtValue | undefined; "weekNumber:open"?: PtValue | undefined; "day:open"?: PtValue | undefined; "dayButton:open"?: PtValue | undefined; "monthItem:open"?: PtValue | undefined; "yearItem:open"?: PtValue | undefined; })

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: arrow, cellColumnHeader, day, dayButton, header, item, month, monthItem, panel, root, sheet, week, weekNumber, year, yearItem. States: active, disabled, highlighted, inRange, open, outside, rangeEnd, rangeStart, selected, today.

See example
range Type: booleanDefaultfalse

Enables range selection ([start, end]).

Keep the model an array, with [] as the empty state.

See example
readonly Type: booleanDefaultfalse

Prevents opening while keeping the activator visible.

seconds Type: booleanDefaultfalse

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

selectable Type: ((date: string) => boolean)

Predicate invoked per candidate; return false to disable it. Receives the value in this type's shape — YYYY-Www under week (so a week is enabled or disabled whole), YYYY-MM under month, YYYY under year.

For rules a window cannot express, such as weekdays or stock. Rejected dates are already disabled and announced, so do not add a click guard of your own.

See example
step Type: numberDefault1

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

time Type: string | string[] | null

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

today Type: string

Today's date, an ISO day like the values ('2025-12-11'; a date-time is read to its day): the day marked today and the month an empty calendar opens on. Unset: the browser's date. Also a config default (all.today).

Fixes the day marked today and the month an empty calendar opens on; marked on the server too. An app-wide default goes in components.all.today.

See example
transitionDuration Type: numberDefault250

Popover/sheet transition duration in milliseconds.

type Type: DatePickerTypeDefault"date"

What the picker selects and emits: date (a day), datetime (a day plus a time rail), week (an ISO week, YYYY-Www: any day of a row picks its week), month (YYYY-MM) or year (YYYY). week / month / year force floating, ignore utc, and leave the time props inert.

See example
utc Type: booleanDefaultfalse

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

Only when the receiving API requires a Z timestamp. The default local offset is the same instant, and reading accepts both.

See example

v-model

Values kept in sync through v-model.

NameDescription
activeSegment Type: BbCalendarSegment
modelValue Type: string | string[] | null
month Type: string
open Type: boolean

Bound, your ref opens and closes the calendar and receives every close the user makes. A static :open is only the initial state; disabled and readonly refuse an open from code.

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

With floating it is the only place the time is stored, so bind it. The model is 24-hour whatever ampm displays.

See example

Events

NameDescription
active Type: (value: BbDateValue): void

Focus or a click entered the activator or the panel, with the current value.

grid-pick Type: (value: string | string[] | null): void

Relay of the raw calendar-grid pick, before the calendar combines it with the time. An embedding host binds this to run its own value engine; clean consumers ignore it and use update:modelValue.

hidden Type: (): void

Emitted once the calendar surface has finished closing.

hide Type: (): void

Emitted as soon as the calendar surface starts to close.

inactive Type: (value: BbDateValue): void

Focus or a click left both the activator and the panel, with the current value, whether or not it changed.

show Type: (): void

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

shown Type: (): void

Emitted once the calendar surface is open and its open transition has finished.

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

Relay of the raw time-rail pick. An embedding host binds this to run its own value engine; clean consumers ignore it and use update:time.

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

The active range end changed (range + type="datetime" only).

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

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

update:month Type: (value: string): void

The user paged to another month: its first day, ISO (v-model:month).

update:open Type: (value: boolean): void

The panel opened or closed (v-model:open).

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

Companion time model, alongside every change while type="datetime".

value-commit Type: (value: BbDateValue): void

Emitted once the user finishes a pick, after update:modelValue, with the same value: each day pick or toggle (and time pick under type="datetime"); a range only once both ends are set. Never for a value you set.

The hook for saving: once per pick, a range once both ends are set. Never for a value your code sets.

See example

Slots

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

NameDescription
<YYYY-MM-DD> Type: BbCalendarDaySlotProps

One date's button label (e.g. #2024-03-15: the local YYYY-MM-DD, which slotKey leaves as it is); beats day. Day grid only.

Named after the local date exactly as written: #2026-12-25.

See example
<YYYY-MM-DD>:append Type: BbCalendarDaySlotProps

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

For a marker under one fixed date, such as #2026-12-25:append. It wins over day:append on that date.

See example
activator Type: BbDatePickerActivatorSlotProps

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

Its props carry the click handler, the anchor, the accessible name (aria-labelledby) and the open state; bind all of them to the clickable element.

See example
day Type: BbCalendarDaySlotProps

Replaces the day button label inside each calendar day.

See example
day:append Type: BbCalendarDaySlotProps

Appends content below each calendar day.

The lighter choice for a marker under the number. Reach for day only to replace the number itself. Its text is read as the day's description; the scope also carries today and disabled.

See example

Renamed and removed

Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.

  • slotappend:<x><x>:appendfails silently
  • slotappend:dayday:appendfails silently
  • datetimetypefails silently
  • pt:columnHeaderpt:cellColumnHeaderfails silently