Bridge UI

Calendar

Standalone calendar with date, month, and year panels for single, multiple, and range selection.

Introduction

Calendar is a standalone date picker surface with date, month, and year panels. It renders inline (not in a popover) and supports single, multiple, and range selection out of the box.

Calendar is the building block behind the popover-based pickers—DateField and DatePicker wrap it with a text input and overlay. Reach for Calendar directly when you want the grid visible at all times, such as in a sidebar, dashboard widget, or a custom scheduling layout.

Import

import { Calendar } from "@bridge-ui/vue/Components/Calendar";
import { Calendar } from "@bridge-ui/react/Components/Calendar";

Basic usage

Bind the selection with value/onChange in React or v-model in Vue. For uncontrolled usage with an initial value, use defaultValue in React or default-value in Vue. Use viewDate (React) / view-date (Vue) to control which month is initially displayed.

Range selection

Enable range to select a start/end pair. The bound value becomes a two-item tuple [start, end]; hovering a candidate end date previews the in-between fill before the second date is committed.

For a form field built on top of range selection, see DateRangeField. For a dual-month layout with two date panels side by side, see CalendarRange.

Multiple selection

Enable multiple to allow selecting any number of individual dates. The bound value becomes an array of dates; clicking a selected date removes it from the array.

Granularity

granularity sets the deepest panel that can commit a value: day (default), month, or year. Month and year still commit a Date, on the first day of that unit. defaultView opens on that panel and is clamped so it cannot go deeper. hideMonths is ignored when granularity is month; hideYears is ignored when granularity is year.

<Calendar granularity="month" />

<Calendar granularity="year" />

Bounds and disabled dates

Restrict the selectable range with minDate and maxDate, and block individual dates with disableDates. Out-of-range and disabled tiles render with muted, non-interactive styling. Pair with disableMonths and disableYears to block entire months or years from the month/year panels.

Colors

Use the color prop to change the accent used for selected tiles across the date, month, and year panels. Available colors: primary (default), secondary, success, info, warning, error, dark, and black.

Building blocks

Calendar composes three smaller, independently usable panels—swap them in when you only need one grid instead of the full month/year-switching chrome:

  • CalendarDate — the weekday header and day grid. Supports the same range/multiple selection modes as Calendar.
  • CalendarMonth — a 12-tile month grid (0–11) for a given year.
  • CalendarYear — a paginated year grid (pageSize years per page, default 15).

DateField, DateRangeField, DatePicker, CalendarRange

Accessibility

  • The active panel (date, month, or year) exposes a header with a live text label (month/year or year-page range) and previous/next/today navigation buttons.
  • Day, month, and year tiles are rendered as buttons, so they receive keyboard focus and can be activated with Enter or Space.
  • Disabled and out-of-range tiles are marked non-interactive and skipped by pointer and keyboard activation alike.
  • When embedding Calendar without a visible page heading nearby, add aria-label (via customProps.root) so assistive technology has context for the grid.

Anatomy

Calendar renders a header and a single body panel that swaps between date, month, and year grids:

Calendar (root)
├── Header
│   ├── Year selector — current year label, switches to the year panel
│   ├── Month selector — current month label, switches to the month panel
│   └── Nav — previous, today, and next buttons (date panel)
└── Body — active panel
    ├── CalendarDate — weekday row + day tiles (default view)
    ├── CalendarMonth — month tiles (when the month selector is active)
    └── CalendarYear — year tiles (when the year selector is active)

API

Prop Type Default Description
default-value DatePickerModel null Initial value for uncontrolled usage (without v-model).
v-model DatePickerModel — Two-way binding for the selection model (single, multiple, or range).
Prop Type Default Description
defaultValue DatePickerModel null Initial value for uncontrolled usage.
onChange (value: DatePickerModel) => void — Called when the selection model changes.
value DatePickerModel — Controlled selection model. Use with onChange.

Calendar-specific

Prop Type Default Description
classes CalendarClasses — Classes for root, header, body, selector, and navButton.
color CalendarColor "primary" Accent color for selected tiles.
customProps CalendarCustomProps — Extra props for internal parts (root, header, navButton, todayButton, selector, etc.).
defaultView / default-view CalendarView matches granularity Uncontrolled initial panel. Clamped so it is not deeper than granularity.
disabled boolean false Disables the whole calendar.
disableDates / disable-dates Date[] — Dates that cannot be selected.
disableMonths / disable-months number[] — Month indexes (0–11) that cannot be selected.
disableYears / disable-years number[] — Years that cannot be selected.
error boolean false Applies the error color palette to tiles.
fill boolean false Fills the container width.
granularity "day" | "month" | "year" "day" Deepest selectable panel. Month and year commit as a Date.
hideMonths / hide-months boolean false Hides the month selector and month panel. Ignored when granularity is "month".
hideOutsideDays / hide-outside-days boolean false Hides days that fall outside the displayed month.
hideWeekdays / hide-weekdays boolean false Hides weekday labels on the date panel.
hideYears / hide-years boolean false Hides the year selector and year panel. Ignored when granularity is "year".
maxDate / max-date Date — Latest selectable date.
minDate / min-date Date — Earliest selectable date.
multiple boolean false Allows selecting multiple dates.
previewDate / preview-date Date | null — Controlled range-preview hover date.
range boolean false Selects a start/end date range.
readOnly / read-only boolean false Prevents selection while keeping tiles visible.
rounded CalendarRounded "md" Border radius of tiles and chrome.
slots CalendarDateSlots — Named slots forwarded to CalendarDate (day).
startOfWeek / start-of-week StartOfWeek 0 First day of the week (0 = Sunday).
timeZone / time-zone string global.timeZone IANA time zone for the UI wall clock. The value Date is a UTC instant.
view CalendarView — Controlled panel view. Pair with onViewChange (React) or @view-change (Vue).
viewDate / view-date Date — Controlled displayed month. Pair with onViewDateChange (React) or @view-date-change (Vue).

Events

Event Payload Description
@preview-date-change date: Date | null Emitted when the range-preview hover date changes.
@view-change view: CalendarView Emitted when the active panel view changes.
@view-date-change date: Date Emitted when the displayed month changes.
Prop Payload Description
onPreviewDateChange (date: Date | null) => void Called when the range-preview hover date changes.
onViewChange (view: CalendarView) => void Called when the active panel view changes.
onViewDateChange (date: Date) => void Called when the displayed month changes.

CalendarMonth and CalendarYear

When used standalone, CalendarMonth and CalendarYear bind a plain number instead of a DatePickerModel:

Component Binding Extra props
CalendarMonth value/onChange (React) or v-model (Vue) — number (0–11) year — year context used to bound months by minDate/maxDate.
CalendarYear value/onChange (React) or v-model (Vue) — number pageSize (default 15) and startYear control paging.

Both share color, rounded, disabled, error, readOnly, minDate/maxDate, timeZone, and the disable lists with Calendar. CalendarMonth accepts disableDates, disableMonths, and disableYears. CalendarYear accepts disableDates and disableYears. On a commit panel, disableDates is compared at month or year precision.

When the month or year grid is the panel that commits the value, it also accepts:

Prop Type Default Description
multiple boolean false Selects multiple months or years.
previewDate / preview-date Date | null — Controlled range-preview hover date.
range boolean false Selects a month or year range.
selection DatePickerModel — Date model used to highlight tiles.
Event Payload Description
@change month or year number Emitted when a month or year tile is selected.
@preview-date-change date: Date | null Emitted when the range-preview hover date changes.
Prop Payload Description
onChange (value: number) => void Called when a month or year tile is selected.
onPreviewDateChange (date: Date | null) => void Called when the range-preview hover date changes.