Calendar
A month to pick a day or a stretch of days from.
November 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Installation
pnpm dlx @human-kit/design add calendarnpx @human-kit/design add calendaryarn dlx @human-kit/design add calendarbunx @human-kit/design add calendarThe command copies the files to src/lib/components/ui/calendar. It also
installs the packages that the files import.
Usage
<script lang="ts">
import * as Calendar from '$lib/components/ui/calendar';
let value = $state<string | null>('2026-11-20');
</script>
<Calendar.Root aria-label="Appointment day" bind:value /> Examples
Locale
Wrap the calendar in a LocaleProvider: the month, the weekdays and the first day of the week follow it, here in Colombian Spanish, German and Arabic. In a right-to-left page the arrows turn with it.
noviembre 2026
| dom | lun | mar | mié | jue | vie | sáb |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
November 2026
| Mo | Di | Mi | Do | Fr | Sa | So |
|---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
نوفمبر ٢٠٢٦
| س | ح | ن | ث | ر | خ | ج |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Range and closed days
selectionMode="range" takes a { start, end }: the first press sets one end, the second the other, and the days between join into one band. isDateUnavailable keeps days in sight that cannot be taken, here the weekends.
November 2026 - December 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Guidelines
- Use a calendar where the month stands on the page, as in a booking screen. In a form, use a date picker: it holds the same month in a popover behind a field.
- Use
outlinefor a month on the page,filledfor one that should read lighter than a card, andghostinside a popover or a card that already has a box. - Dates are
YYYY-MM-DDstrings, with no time and no zone, so a day never shifts by the user’s offset. - Use
minValueandmaxValuefor a window, andisDateUnavailablefor single days that are taken or closed. - Show two months with
visibleMonths={2}for a range that often crosses a month’s end. - The month names, the weekdays and the first day of the week come from the locale: wrap the app in a
LocaleProvider, or setfirstDayOfWeek.
Accessibility
- Each month is a
gridnamed by its heading. Today carriesaria-current="date", and the weekday over each column is named in full. - The days take one tab stop. The arrows move a day or a week,
HomeandEndgo to the first and the last day of the month,PageUpandPageDownchange the month, andEnterorSpacepick the day. - In a range, the keys move the far end of the band until
EnterorSpaceconfirm it. - An unavailable day is
aria-disabled, and stays reachable by the keyboard so a screen reader user finds it. - The two month arrows are buttons named by
previousLabelandnextLabel. - Give the calendar an
aria-labelthat says what the day is for.
API reference
| Prop | Type | Default |
|---|---|---|
variant | 'outline' | 'filled' | 'ghost' On a card of its own, on a soft grey, or the month alone. | 'outline' |
selectionMode | 'single' | 'range' One day, or a stretch of days. | 'single' |
value | string | { start?: string; end?: string } | null The chosen day, or the range, as | — |
defaultValue | string | { start?: string; end?: string } The choice at the start, when you give no | — |
onChange | (value) => void Called with the new day or range when the user picks. | — |
visibleMonths | number How many months show side by side. | 1 |
showOutsideDays | boolean Fills the first and the last week with the days of the months around it. | false |
weekdayStyle | 'narrow' | 'short' | 'long' How the weekdays over the columns are written. | 'short' |
firstDayOfWeek | 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' The first column. Without it, the locale’s. | — |
monthHeadingStyle | 'month-year' | 'composed'
| 'month-year' |
minValue | string The first day that can be picked. The arrows and the focus stop there. | — |
maxValue | string The last day that can be picked. | — |
isDateUnavailable | (date: string) => boolean Marks the days that show and cannot be picked. | — |
disabled | boolean Turns off the whole calendar. | false |
readonly | boolean Shows the choice and refuses changes. | false |
previousLabel | string The name of the left arrow, read aloud. | 'Previous month' |
nextLabel | string The name of the right arrow, read aloud. | 'Next month' |
aria-label | string What the day is for. | — |
id | string The id of the root. | — |
It takes these props alone; class goes on the root.