Skip to content
caliper ui docs

Components

Calendar

A month grid for choosing a day or a range, usable on its own or inside a picker.

Free
pnpm dlx shadcn@latest add @caliper/calendar

Book a demo with Lena Fischer

30 minutes · video call · times in CET

Lena FischerSolutions, Halden Analytics

October 2026

Oct 23, 2026 · 5 open times

Installs components/ui/calendar.tsxDepends on lucide-reactMotion none in component source

When to use

Use it for

  • An always-visible date chooser on a booking or planning page.
  • As the building block for date pickers.

Skip it when

  • A date field in a form; use a date picker.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/calendar

Adds its 3 files to components/ui/, each with its own stylesheet, and installs their packages. No account needed. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage

This is the code behind the preview above. It is built from Calendar, formatISODate, isoDate and parseISODate.

example.tsx
import { useState, type ReactNode } from "react"
import { Avatar } from "@/components/ui/avatar"
import { Calendar, formatISODate } from "@/components/ui/calendar"

function Panel({ title, context, className = "max-w-md", children }: { title: string; context: string; className?: string; children: ReactNode }) {
  return (
    <section className={`grid w-full gap-5 rounded-overlay border border-border bg-background p-6 shadow-resting ${className}`}>
      <div className="grid gap-1">
        <p className="font-medium">{title}</p>
        <p className="text-sm text-muted-foreground">{context}</p>
      </div>
      {children}
    </section>
  );
}

const openTimes: Record<string, string> = { "2026-10-22": "3 open times", "2026-10-23": "5 open times", "2026-10-27": "2 open times", "2026-10-29": "4 open times", "2026-10-30": "1 open time" };

export function BookingCalendar() {
  const [day, setDay] = useState<string | null>("2026-10-23");
  return (
    <Panel title="Book a demo with Lena Fischer" context="30 minutes · video call · times in CET" className="max-w-sm">
      <div className="flex items-center gap-3">
        <Avatar name="Lena Fischer" className="size-10" />
        <span className="grid text-sm"><span className="font-medium">Lena Fischer</span><span className="text-muted-foreground">Solutions, Halden Analytics</span></span>
      </div>
      <Calendar label="Choose a day" selected={day} onSelect={setDay} marks={(iso) => openTimes[iso]} showToday className="justify-self-center" />
      <p role="status" className="text-sm text-muted-foreground">{day ? `${formatISODate(day)} · ${openTimes[day] ?? "no open times, try another day"}` : "Pick a day to see open times."}</p>
    </Panel>
  );
}

API reference

Calendar

component
PropTypeDefaultDescription
labelstring—
yearnumber—
monthnumber—
onMonthChange((year: number, month: number) => void)—
selectedstring | null—
rangeStartstring | null—
rangeEndstring | null—
onSelect((iso: string) => void)—
onHover((iso: string | null) => void)—
minstring—
maxstring—
disabledDates((iso: string) => boolean)—
disabledReason((iso: string) => string | undefined)—Read with an unavailable day, e.g. "banks closed".
marks((iso: string) => string | undefined)—A quiet data mark under the day, e.g. invoices due; the label is read with the date.
showTodaybooleanfalse
classNamestring—

formatISODate

component

No props of its own; it accepts the native props of its root element.

isoDate

component

No props of its own; it accepts the native props of its root element.

parseISODate

component

No props of its own; it accepts the native props of its root element.

Accessibility

It exposes grid and gridcell semantics, with aria-label, aria-disabled, aria-hidden, aria-live, aria-selected and aria-current kept in step with state. Changes that matter are announced through a live region.

KeyBehaviour
← / →Moves to the previous or next day.
↑ / ↓Moves to the same day in the previous or next week.
Home / EndMoves to the first or last day of the week.
PageUp / PageDownMoves to the same day in the previous or next month. With Shift, the previous or next year.
Enter / SpaceSelects the focused day.

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Dates examples