Searching Puzzle Pieces

Type to search Puzzle Pieces.

Calendar

An inline month-grid calendar with days / months / years drill-down, full keyboard navigation, min/max bounds plus disabledDates, and locale-aware labels via Intl. It is parent-owned: it never mutates value, it fires @change and the parent writes the new ISO date back.

S
M
T
W
T
F
S

Selected: 2026-07-16

Installation

Copy the piece and its date helper into your app — they compile with your build and the code is yours:

puzzle add piece calendar

date-math.js is a shared lib file — Calendar imports it as ../../lib/date-math.js. Keep it in app/lib/.

Usage

import Calendar from '@/components/ui/Calendar.pzl';
<Calendar value={ date } @change={ setDate } />

Bounds and disabled dates

S
M
T
W
T
F
S

Weekdays only, July–August 2026.

First day of week

M
T
W
T
F
S
S

Day snippet

S
M
T
W
T
F
S

Dots mark days that have events. The snippet is stamped inside each day button, so it must stay decorative — Calendar keeps the button, its ARIA, and the keyboard grid.

Keyboard

The day grid is a roving-tabindex grid — one Tab stop lands on the active day, then the keys move the focus:

  • ← → move by one day; ↑ ↓ move by one week (±7 days).
  • Home and End jump to the start and end of the focused week.
  • Page Up and Page Down move by one month; hold Shift to move by one year.
  • Enter or Space selects the focused day.
  • Activate the header label to drill down into the months and years views; the arrows rove those grids too, and Escape backs out one level.

From a trigger, with morph

Calendar is inline-only by design. To open it from a button, compose it through DatePicker — with the morph prop, the trigger itself morphs into the calendar panel.