Basel Standard

Basel Standard / Docs

Calendar

Date selection primitive built on react-day-picker with Swiss-styled navigation, range states, and dropdown captions.

March 2026

The calendar is for choosing a date or date range without leaving the current workflow. In this system it stays compact, typographic, and neutral enough to sit inside popovers, cards, scheduling panels, or booking flows.

Installation

Install
Purchase access, then open /account/install to issue a registry token.

Usage

import { Calendar } from "@/components/ui/calendar"
<Calendar
  mode="single"
  selected={date}
  onSelect={setDate}
/>

Why This Primitive Exists

The Swiss calendar wraps react-day-picker so the project can keep its full selection model while matching the rest of the design system.

  • Use it when the user needs to pick a concrete day or span of days.
  • Prefer it to a freeform text input when accuracy matters more than speed.
  • Keep it close to the task it affects, such as booking, review scheduling, or release planning.

Examples

Single Date Selection

Start with mode="single" when the workflow depends on one exact date.

March 2026
<Calendar
  mode="single"
  selected={date}
  onSelect={setDate}
/>

Range Selection

Switch to mode="range" when the user is defining a window rather than a point in time. The component already styles range_start, range_middle, and range_end states, so range mode reads clearly without extra class work.

March 2026
April 2026
Review window
Mar 24-27
Range mode works well for bookings, review sprints, and editorial scheduling.
<Calendar
  mode="range"
  numberOfMonths={2}
  selected={range}
  onSelect={setRange}
/>

The wrapper supports captionLayout="dropdown" and a repo-specific buttonVariant prop. That combination is useful when a scheduling surface needs explicit month and year controls without introducing a louder navigation treatment.

Scheduling panel

Use the calendar to anchor date choice inside a larger workflow.

Dropdown captions and muted action styling keep the picker usable in denser admin layouts.

September 2026
Editorial release
Pair the picker with nearby status and confirmation controls so readers can see what the chosen date affects.
<Calendar
  mode="single"
  captionLayout="dropdown"
  buttonVariant="outline"
  selected={releaseDate}
  onSelect={setReleaseDate}
/>

In Context

The calendar is strongest when the selected date sits next to the status, owner, and action it changes. That keeps the scheduling decision concrete instead of abstract.

Release planning

Keep the selected date next to the status it changes.

The calendar does the selection work while nearby summary text, owners, and actions keep the schedule legible.

September 2026
Issue 08 release
Fri, Sep 12
Pair the picker with confirmation, ownership, and downstream status instead of leaving the chosen date to stand alone.
<div className="grid gap-4 lg:grid-cols-[auto_18rem]">
  <Calendar
    mode="single"
    selected={releaseDate}
    onSelect={setReleaseDate}
    buttonVariant="outline"
  />
  <div>{/* release summary, status, and confirmation actions */}</div>
</div>

Guidance

Pick The Right Selection Mode

  • Use single for due dates, publish dates, or one-off appointments.
  • Use range for stays, review windows, and travel or availability spans.
  • Use multiple only when several independent days can be selected at once.

Keep The Calendar Near Its Consequence

  • Pair it with summary text or actions that explain what the chosen date changes.
  • If the user still needs time, timezone, or recurrence rules, keep those controls adjacent instead of overloading the day cell UI.
  • Avoid dropping a full calendar into a page when a compact popover or side panel would keep focus clearer.

Use Customization Sparingly

  • Reach for buttonVariant to match the surrounding surface, not to create hierarchy inside the calendar itself.
  • Use captionLayout="dropdown" when readers need faster month/year jumps.
  • Pass classNames, components, or formatters only when you genuinely need to extend react-day-picker behavior.

API Reference

Calendar

Calendar forwards React.ComponentProps<typeof DayPicker>, so the underlying react-day-picker props such as mode, selected, onSelect, disabled, numberOfMonths, captionLayout, and defaultMonth remain available.

PropTypeDefaultNotes
buttonVariantReact.ComponentProps<typeof Button>["variant"]"ghost"Applies the Swiss button variant to previous and next month controls.
showOutsideDaysbooleantrueOutside-month days remain visible by default.
captionLayoutDayPicker prop"label"Supports dropdown captions when faster navigation is needed.
classNamesDayPicker propmergedExtends the wrapper's default Swiss class map.
componentsDayPicker propmergedLets you override slots while keeping the default wrapper behavior.

CalendarDayButton

The file also exports CalendarDayButton, the custom day-cell button used by the wrapper.

ExportPurpose
CalendarDayButtonHandles focused state, single-date selection styling, and range markers while rendering through the shared Button primitive.