Calendar
A board of date tiles. Pick one day or a range; marked days get a dot. Full keyboard support and no date library.
Picked Sunday, December 6 · dots are market days
Installation
Usage
Keyboard: arrows move a day or a week, Home and End go to the week's start and end, PageUp and PageDown change the month (with Shift, the year), Enter or Space picks.
Uses the native Date in local time; bring your own date library only for formatting if you like.
Examples
Range
mode="range": the first tap sets the start, the second the end, and the band previews as you hover. Sundays are disabled here.
4 nights at the lantern festival · closed on Sundays
Date picker
A Calendar inside a Popover, opened from an outline Button. Past days are disabled.
API
Everything else is passed through to the underlying element or Radix primitive.
| Prop | Type | Default | Description |
|---|---|---|---|
mode | "single" | "range" | "single" | One day, or a from–to range. |
selected | Date | { from?: Date; to?: Date } | – | The picked day or range (controlled). |
onSelect | (value) => void | – | Called with the new day (or undefined when unpicked), or the new range. |
disabled | (day: Date) => boolean | – | Return true to disable a day, e.g. past days or Sundays. |
marked | Date[] | – | Days that get a small dot: events, market days, harvests. |
month / defaultMonth / onMonthChange | Date | selected or today | The month shown. |
weekStartsOn | 0 | 1 | 1 | Sunday or Monday. |
locale | string | browser | BCP 47 locale for month and weekday names, e.g. "vi-VN". |