Skip to content

BbDatePickerInput

Combines date selection with text input behavior.

import { BbDatePickerInput } from 'bitboss-ui';

On this page

Props

NameDescription
adaptive Type: booleanDefaultconfig.adaptive (true)

On mobile the calendar opens inside a bottom off-canvas sheet instead of a floating popover, mirroring the adaptive behaviour of BbPopover/BbSelect. When unset, falls back to the global config.adaptive.

On by default in v3. Set :adaptive="false" to keep the popover on every viewport.

See example
ampm Type: booleanDefaultfalse

12-hour display with an AM/PM segment (requires type="datetime"). Purely a field-composition concern: modelValue and the time model stay 24-hour regardless. Type A/P (or ArrowUp/Down) to set the meridiem.

append:icon Type: string

Name of the icon to be added at the end of the input.

autocomplete Type: stringDefault"off"

Guides the browser as to the type of information expected in the field.

autofocus Type: Booleanish

Focuses the field when it mounts (a dialog already open included), unless the user is typing in another field.

clearable Type: booleanDefaultfalse

Displays a clear button when the input has a value and is being interacted with.

compact Type: booleanDefaultfalse

Compact density: the field uses the -compact twins of --bb-input-h, --bb-input-py and --bb-label-spacing-y, so a --bb-input-h set on the component is ignored while it is on. Size a compact field with --bb-input-h-compact (and --bb-input-py-compact).

description Type: string

Text between the label and the input. Unlike the hint it is always visible; it joins the input's aria-describedby after any errors / warnings, before the hint.

disableCalendar Type: boolean | "mobile" | "desktop"Defaultfalse

Disables the calendar: hides the trigger button and prevents the popover from opening. Use 'desktop' to disable it on desktop only (keeping the calendar for mobile, complementing disableWriting: 'mobile') or 'mobile' to disable it on mobile only.

Replaces v2 hide-popover; the v2 token not-mobile becomes desktop.

See example
disabled Type: booleanDefaultfalse

Disables the component.

disableWriting Type: boolean | "mobile" | "desktop"Defaultfalse

Disables typing into the input. Use 'mobile' to disable typing only on mobile, 'desktop' to disable typing only on desktop.

Replaces v2 allow-writing, with the polarity inverted; the v2 token not-mobile becomes mobile.

See example
errors Type: string | string[]

Error messages under the field, a string or array, in an aria-live="polite" region and first in the control's aria-describedby, so they are re-read when it regains focus.

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

floating Type: booleanDefaultfalse

If true the date will have a format YYYY-MM-DD instead of the default ISO string.

Use it when “2027-01-01” must stay that day everywhere. Leave it off for an instant; seed a floating value, or start empty, on server-rendered pages.

See example
formless Type: booleanDefaultfalse

Keep this control out of the enclosing BbForm entirely: not submitted, not dirty, not reset, not validated. For a control that is not form data (a filter, a "show advanced" switch).

See example
hasErrors Type: booleanDefaultfalse

Define if the component should be in an error state. It usually attaches a CSS class for styling purposes.

hasWarnings Type: booleanDefaultfalse

Define if the component should be in a warning state. Same chrome as errors with --bb-warn; errors take priority.

hideLabel Type: booleanDefaultfalse

Visually hides the label of the input while maintaining accessibility.

hint Type: string

Text box to be displayed near the input, usually to indicate instructions.

id Type: string

The id of the native control; the label's for and the description and message ids derive from it. Generated when omitted.

inputAlign Type: FieldCrossAlign

Vertical position of the control in a side-by-side row; not inputPosition, the horizontal one. Omitted, the control's first line meets the label's.

label requiredType: string

Text content of the label of the element.

See example
labelAlign Type: FieldCrossAlign

Vertical position of the label block in a side-by-side row; not labelPosition, the horizontal one. Omitted, the label's first line meets the control's.

labelMode Type: "outside" | "floating" | "inside"

Label rendering mode.

labelPosition Type: "left" | "center" | "right"

Sets the text alignment of the label.

layout Type: Responsive<FieldLayout>

How label and input sit together: 'vertical', 'horizontal' (50/50), 'auto', 'label-fill', 'input-fill', a ratio like 'xx xxxxx', or a per-breakpoint map ({ default: 'vertical', md: 'xx xxxxx' }).

loading Type: booleanDefaultfalse

Sets the component in a loading state, usually triggering some visual styles.

max Type: string

Maximum selectable date in YYYY-MM-DD format — or, with type="datetime", YYYY-MM-DDTHH:mm to tighten the boundary day to a minute. Values outside both patterns throw during setup to surface configuration mistakes.

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

See example
min Type: string

Minimum selectable date in YYYY-MM-DD format — or, with type="datetime", YYYY-MM-DDTHH:mm to tighten the boundary day to a minute. Values outside both patterns throw during setup to surface configuration mistakes.

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

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

Used by v-model. Can be null, a single string, or an array of strings based on whether a range or single date is needed.

name Type: string

Defines the name of the input.

The key the value is submitted under: in a native form post or FormData, and inside a BbForm, which falls back to a slug of the label without it.

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.

v2 spelled it offcanvas-props; the old name falls through as an attribute and does nothing.

See example
persistentHint Type: booleanDefaultfalse

Keeps the hint displayed.

placeholder Type: string

Text shown while the field is empty.

prepend:icon Type: string

Name of the icon to be added at the start of the input.

pt Type: (PtMap<BbDatePickerInputPtPart, BbDatePickerInputPtState> & { "root:outline"?: PtValue | undefined; "icon:outline"?: PtValue | undefined; "root:secondary"?: PtValue | undefined; "icon:secondary"?: PtValue | undefined; "spinner:outline"?: PtValue | undefined; "spinner:secondary"?: PtValue | undefined; "clear:outline"?: PtValue | undefined; "clear:secondary"?: PtValue | undefined; "root:ghost"?: PtValue | undefined; "icon:ghost"?: PtValue | undefined; "spinner:ghost"?: PtValue | undefined; "clear:ghost"?: PtValue | undefined; "label:outline"?: PtValue | undefined; "label:secondary"?: PtValue | undefined; "label:ghost"?: PtValue | undefined; "description:outline"?: PtValue | undefined; "description:secondary"?: PtValue | undefined; "description:ghost"?: PtValue | undefined; "message:outline"?: PtValue | undefined; "message:secondary"?: PtValue | undefined; "message:ghost"?: PtValue | undefined; "hint:outline"?: PtValue | undefined; "hint:secondary"?: PtValue | undefined; "hint:ghost"?: PtValue | undefined; "input:outline"?: PtValue | undefined; "input:secondary"?: PtValue | undefined; "input:ghost"?: PtValue | undefined; "box:outline"?: PtValue | undefined; "box:secondary"?: PtValue | undefined; "box:ghost"?: PtValue | undefined; "prefix:outline"?: PtValue | undefined; "prefix:secondary"?: PtValue | undefined; "prefix:ghost"?: PtValue | undefined; "suffix:outline"?: PtValue | undefined; "suffix:secondary"?: PtValue | undefined; "suffix:ghost"?: PtValue | undefined; "activator:outline"?: PtValue | undefined; "activator:secondary"?: PtValue | undefined; "activator:ghost"?: 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: activator, arrow, box, cellColumnHeader, clear, day, dayButton, description, header, hint, icon, input, item, label, message, month, monthItem, panel, prefix, root, sheet, spinner, suffix, year, yearItem. States: active, disabled, errors, ghost, hasValue, highlighted, inRange, loading, open, outline, outside, rangeEnd, rangeStart, readonly, secondary, selected, today, warnings.

See example
range Type: booleanDefaultfalse

Selects a range of dates between two dates. It selects all of the days between start and end.

Keep the model an array: seed and clear it with [].

See example
readonly Type: booleanDefaultfalse

Sets the input in a readonly state.

required Type: booleanDefaultfalse

Sets the input as required.

reverse Type: booleanDefaultfalse

Reverses the layout. Applicable in every direction the order of the label and the input is swapped.

rules Type: RuleExpression<string | string[] | null>

vee-validate rules for this field. Only inside a BbForm.

See example
seconds Type: booleanDefaultfalse

Adds the seconds segment (requires type="datetime"). Without it, an incoming value carrying seconds displays truncated and is left untouched until the user commits an edit, at which point seconds zero out.

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

Function that accepts a string object and returns a boolean. false meaning the date cannot be selected.

See example
step Type: numberDefault1

Minute granularity for the calendar's minute column and arrow stepping (requires type="datetime"). Constrains what the component produces, never what it accepts: a typed off-grid value (e.g. 10:07 with step: 15) is emitted verbatim, and no column row highlights for it.

time Type: string | string[] | null

v-model:time: the time part, always 24-hour HH:mm / HH:mm:ss. With floating it is the only carrier of the time; otherwise it mirrors modelValue's, and writing it rewrites that. Requires type="datetime".

transitionDuration Type: number

Transition duration, in milliseconds, for the popover appearance.

type Type: DatePickerTypeDefault"date"

What the field edits, and so its segments and emitted shape: date (DD/MM/YYYY), datetime (adds the time segments and rail), month (MM/YYYY, emits YYYY-MM) or year (YYYY). month / year force floating, ignore utc, and leave the time props inert.

See example
utc Type: booleanDefaultfalse

Emits UTC ISO strings (…Z) instead of the local offset (…+01:00). Emission only: incoming values parse the same either way, and the field always displays local time. Ignored with floating.

Only when the receiving API requires a Z timestamp (the v2 format). Reading accepts both, so stored values need no rewrite.

See example
validationLabel Type: string

The field's name in validation messages ({field}): "Email is not valid". Defaults to the label (or legend), then "This field"; never the name. Set it when the label is hidden or reads badly in a sentence (icon-only, a question). BbForm only.

validationMode Type: ValidationMode

When the field validates: aggressive (each change), balanced (on leave, then live while in error), lazy (on leave), submit-only, submit-live. Unset: the BbForm's validation-mode, then formControls.validationMode ('balanced'). BbForm only.

variant Type: InputVariantTypeDefault'outline'

The field box's look, with BbButton's names and tokens. Colours only, so a form never reflows; 'ghost' has no border in any state, 'none' no look at all (you own hover, focus and the states). Register more with the plugin's inputVariants.

warnings Type: string | string[]

Warning messages under the field, a string or array: amber, in their own aria-live region and in the control's aria-describedby after the errors. Non-empty turns on the warning state; errors win when both are set.

v-model

Values kept in sync through v-model.

NameDescription
modelValue Type: string | string[] | null
time Type: string | string[] | null

With floating it is the only carrier of the time, so bind it.

See example

Events

NameDescription
active Type: (): void

Emitted when the composite control receives focus (first focusin after being inactive).

error Type: (error: DatePickerInputError): void

Emitted alongside every value normalization or removal when the typed date is invalid or out of range. See DatePickerInputError for the full code map and payload shapes.

Turn the payload into a message through errors. Clear that message on active, not on the model update the normalization itself caused.

See example
focus Type: (event: FocusEvent): void

Emitted when a native text field inside the control gains focus. Forwards the original DOM FocusEvent.

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: (): void

Emitted when focus/click moves outside the entire composite control.

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.

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

Emitted whenever the selected date value changes. Payload is null for cleared values, a single string for single-date mode, or a two-element array for range mode.

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

Companion time model (v-model:time), emitted alongside every value change while type="datetime" is on. Always 24-hour HH:mm (or HH:mm:ss with seconds); null when cleared, an array in range mode.

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.

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

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

append Type: object

Content rendered after the date fields, at the end of the field box (before the calendar toggle button).

append:outer Type: object

Content rendered after the entire date picker control, outside the input chrome.

day Type: { first: boolean; item: string; label: string; last: boolean; middle: boolean; outside: boolean; selected: boolean; }

Replaces the day button label inside each calendar day.

day:append Type: { first: boolean; item: string; label: string; last: boolean; middle: boolean; outside: boolean; selected: boolean; }

Appends content below each calendar day.

description Type: BbDatePickerInputDescriptionSlotProps

Replaces the description text. Provided alone (no description prop) it still renders the description region and wires it into aria-describedby.

label Type: BbDatePickerInputLabelSlotProps

Replaces the default label text rendered above the date picker.

prefix Type: object

Inline content rendered at the start of the input field area, before the date fields.

prepend Type: object

Content rendered before the date fields, at the start of the field box.

prepend:outer Type: object

Content rendered before the entire date picker control, outside the input chrome.

suffix Type: object

Inline content rendered at the end of the input field area, after the date fields.

Renamed and removed

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

  • allowWritingdisableWritingfails silently
  • slotappend-outerappend:outerfails silently
  • slotappend:<x><x>:appendfails silently
  • slotappend:dayday:appendfails silently
  • datetimetypefails silently
  • directionlayoutfails silently
  • hasWarninghasWarningsfails silently
  • hidePopoverdisableCalendarfails silently
  • slotprepend-outerprepend:outerfails silently
  • pt:columnHeaderpt:cellColumnHeaderfails silently
  • validateOnvalidationModefails silently

    An array of events became one mode (aggressive | balanced | lazy | submit-only | submit-live). The old defaults (['blur'], ['inactive'], a toggle's ['update:modelValue', 'change', 'blur']) are balanced, the new default: delete the prop. A text field on ['update:modelValue'] is validation-mode="aggressive". Set it once on <BbForm validation-mode> instead of per field.

  • vidremovedfails silently

    A display name (v2: vid="Email address") is now validation-label; a field path (3.0 betas: vid="address.city") is now name (brackets for a native post: address[city]). check --fix picks by the value.

  • widthremovedfails silently