Calendar

@/components/kamod-ui/calendar

Sun
Mon
Tue
Wed
Thu
Fri
Sat

Installation

Add `@kamod-ch/ui` to your app and import `Calendar`. This implementation mirrors the shadcn/ui Calendar **API surface** (modes, captions, disabled, modifiers, week numbers, RTL) without bundling `react-day-picker`; see [React DayPicker](https://react-day-picker.js.org/) for the upstream reference behaviour.

pnpm add @kamod-ch/ui
Sun
Mon
Tue
Wed
Thu
Fri
Sat

Usage

Import Calendar from `@/components/kamod-ui/calendar`, then control selected/onSelect in mode="single" or pass a DateRange in mode="range". The shadcn Calendar wraps React DayPicker; Kamod provides a lightweight grid with a parallel prop surface for demos and composition. Build a date picker with Popover and Button (see /docs/date-picker/installation in this app). If the highlighted day shifts vs your timezone, pass timeZone from Intl.DateTimeFormat().resolvedOptions().timeZone on the client (useEffect), as documented on ui.shadcn.com. For a tighter layout (e.g. narrow popovers), pass `size="sm"`.

import { Calendar } from "@/components/kamod-ui/calendar";
<Calendar />

Demo

Top-of-page example with `captionLayout="dropdown"` — same role as the live preview on ui.shadcn.com.

Selected Date (With TimeZone)

Pass `timeZone` so captions align with the user’s zone; detect it client-side to avoid SSR hydration mismatches (see shadcn note on the same page).

Sun
Mon
Tue
Wed
Thu
Fri
Sat

Basic

A basic calendar. We use `class="rounded-lg border"` like the shadcn examples.

July 2026
Sun
Mon
Tue
Wed
Thu
Fri
Sat

Range Calendar

Use `mode="range"` with two months and an optional `disabled` predicate — matches the Range Calendar + disabled snippet on ui.shadcn.com.

January 2026February 2026
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat

Month and Year Selector

Use `captionLayout="dropdown"` for month and year `<select>` controls, with ghost prev/next icons on the sides (same chrome as ui.shadcn.com). Month labels follow `locale` (e.g. März → Mär in de-DE).

Sun
Mon
Tue
Wed
Thu
Fri
Sat

Presets

Controlled `month` / `onMonthChange` with preset buttons and `fixedWeeks` for a stable six-row grid.

July 2026
Sun
Mon
Tue
Wed
Thu
Fri
Sat

Date and Time Picker

Calendar plus time fields in the card footer (composition pattern from ui.shadcn.com).

April 2026
Su
Mo
Tu
We
Th
Fr
Sa

Booked dates

`disabled` with `modifiers` and `modifiersClassNames` for strike-through booked days.

February 2026
Sun
Mon
Tue
Wed
Thu
Fri
Sat

Custom Cell Size

Responsive `[--cell-size:…]` and `dayAddon` for secondary labels (e.g. prices). The code tab also shows fixed `rem` / spacing-token variants from the shadcn page.

Sun
Mon
Tue
Wed
Thu
Fri
Sat

Week Numbers

Use `showWeekNumber` to show ISO week indices (zero-padded), in line with the shadcn example.

February 2026
Sun
Mon
Tue
Wed
Thu
Fri
Sat

API Reference

Props, slots and variants for this component.

Calendar

Calendar component props and accepted values.

PropTypeDefault
mode"single" | "range""single"
selectedDate | DateRange | undefinedundefined
onSelect(value: Date | DateRange | undefined) => voidundefined
value / onValueChangeDate + callbackdeprecated; use selected/onSelect
defaultMonthDatefrom selected or today
month / onMonthChangeDate + callbackoptional controlled month
numberOfMonths1 | 21
captionLayout"buttons" | "dropdown""buttons"
size"default" | "sm""default"
dir"ltr" | "rtl""ltr"
showOutsideDaysbooleantrue
fixedWeeksbooleanfalse
disabled((date: Date) => boolean) | Date[]undefined
showWeekNumberbooleanfalse
modifiersRecord<string, Date[]>undefined
modifiersClassNamesRecord<string, string>undefined
localestring (BCP 47)undefined
timeZonestringundefined
dayAddon(date, outside) => children | undefinedundefined
classstringundefined

Accessibility Notes

Day cells are `<button>` elements; prev/next use the shared `Button` ghost icon pattern. Dropdown captions expose `aria-label` on selects. Pair with visible labels in forms.