Skip to content

BbCalendar

A calendar in place — the month grid (or month / year grid, or day grid plus time rail) with no popover and no field chrome; v-model of a day, range, set, month, year or datetime.

import { BbCalendar } from 'bitboss-ui';

On this page

Props

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

ampm Type: booleanDefaultfalse

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

disabled Type: booleanDefaultfalse

Disables every cell, the navigation and the time rail.

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

See example
floating Type: booleanDefaultfalse

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

For delivery days, stays and report filters: a calendar day that must read the same in every timezone.

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. With datetime, on its own day the time rail disables the times after it.

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 finer bound is floored to the unit, with a warning. With datetime the rail also disables the earlier times on its day.

An empty calendar whose window lies entirely after today opens on this month instead of on a disabled grid.

See example
modelValue requiredType: 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-MM / YYYY for month / year), otherwise a zoned ISO instant (carrying the time under datetime).

multiple Type: booleanDefaultfalse

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

See example
pt Type: PtMap<BbCalendarPtPart, BbCalendarPtState>

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, root, year, yearItem. States: active, disabled, highlighted, inRange, outside, rangeEnd, rangeStart, selected, today.

pt:root="[--cell:36px]" resizes the whole grid. Restyle the mark on pt:day-button; a background on pt:day fills the cell square. In the page, raise --cell on phones yourself: only the picker sheet enlarges its days.

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

Shows the calendar and lets the user page through it, but no pick changes the value.

For a confirmed choice that stays on screen. Paging through months still works.

See example
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-MM under month, YYYY under year.

For rules a window cannot express, such as weekends or closures. Refused days are already disabled and announced; add no click guard of your own.

See example
step Type: numberDefault1

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

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

type Type: DatePickerTypeDefault"date"

What the calendar selects and emits: date (a day), datetime (a day plus a time rail), month (YYYY-MM) or year (YYYY). 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="month"/type="year".

v-model

Values kept in sync through v-model.

NameDescription
activeSegment Type: BbCalendarSegment
modelValue Type: string | string[] | null

Empty, the calendar opens on today's month, or the nearest month inside min and max; a prerendered page moves to the reader's month after hydration, so seed it when the opening month matters. Inside a BbForm it is not submitted unless you bind it with useBbFormField.

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

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

See example

Events

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

Relay of the raw grid pick, before this component combines it with the time. An embedding host binds this to run its own value engine (the date picker closes on it once the selection is complete); clean consumers ignore it and use update:modelValue.

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 value changes: a string (single), [start, end] (range), a sorted array (multiple). Empty is null for a single value and [] for a range or multiple, never null.

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

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

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. It replaces the day number on that date only.

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

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

Named after the local date exactly as written: #append:2026-12-25. It wins over append:day on that date.

See example
day Type: BbCalendarDaySlotProps

Replaces the day button label inside each calendar day.

Replaces every day's number, for a price or a symbol in its place.

See example
day:append Type: BbCalendarDaySlotProps

Appends content below each calendar day.

Look the day up from item (a dayjs object) and skip outside days. Every week takes the height of the tallest decorated week.

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
  • pt:columnHeaderpt:cellColumnHeaderfails silently