Calendar · component

A calendar that slides between months, jumps by month or year, walks by keyboard, marks events, numbers weeks, and books ranges across months with a live preview that stops at a booked night.

Events · week numbers · today · click the month or year to jump

#
Su
Mo
Tu
We
Th
Fr
Sa
35
36
37
38
39
40

Selected: none yet — click a day

Dots mark days with events. Keyboard: ← → a day, ↑ ↓ a week, PageUp / PageDown a month (Shift: a year), Home / End, Enter.

A stay · two months · booked nights can't be crossed

September 2026
Su
Mo
Tu
We
Th
Fr
Sa
October 2026
Su
Mo
Tu
We
Th
Fr
Sa

Pick the check-in day.

Crossed-out days next month are booked: a stay stops at the first one.

Usage

JavaScript
import { signal } from "./index.js";import { Calendar } from "./components/calendar.js"; const picked = signal(null);   // omit value for internal state// dots for events, ISO week numbers, a Today link; the header's month and year open pickersCalendar({ value: picked, marks: (d) => events.has(d) && "var(--zap-chart-2)", weekNumbers: true, todayButton: true }) // a stay: two months, nothing before today, booked nights clamp the rangeCalendar({ range: true, start: checkIn, end: checkOut, numberOfMonths: 2, min: today,           disabled: (d) => booked.has(iso(d)), onRange: (a, b) => book(a, b) })// paging mutates 42 fixed nodes per month — no rebuild; the grid slides the way you went