Skip to the content
human-kit design
20 — Pickers

Calendar

A month to pick a day or a stretch of days from.

November 2026

SunMonTueWedThuFriSat
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 calendar
npx @human-kit/design add calendar
yarn dlx @human-kit/design add calendar
bunx @human-kit/design add calendar

The 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

domlunmarmiéjueviesá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

MoDiMiDoFrSaSo
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

SunMonTueWedThuFriSat
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
SunMonTueWedThuFriSat
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 outline for a month on the page, filled for one that should read lighter than a card, and ghost inside a popover or a card that already has a box.
  • Dates are YYYY-MM-DD strings, with no time and no zone, so a day never shifts by the user’s offset.
  • Use minValue and maxValue for a window, and isDateUnavailable for 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 set firstDayOfWeek.

Accessibility

  • Each month is a grid named by its heading. Today carries aria-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, Home and End go to the first and the last day of the month, PageUp and PageDown change the month, and Enter or Space pick the day.
  • In a range, the keys move the far end of the band until Enter or Space confirm 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 previousLabel and nextLabel.
  • Give the calendar an aria-label that says what the day is for.

API reference

PropTypeDefault
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'
valuestring | { start?: string; end?: string } | null

The chosen day, or the range, as selectionMode says. Bindable.

—
defaultValuestring | { start?: string; end?: string }

The choice at the start, when you give no value.

—
onChange(value) => void

Called with the new day or range when the user picks.

—
visibleMonthsnumber

How many months show side by side.

1
showOutsideDaysboolean

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 writes the month, then the year. composed joins them as the locale does, as in "noviembre de 2026".

'month-year'
minValuestring

The first day that can be picked. The arrows and the focus stop there.

—
maxValuestring

The last day that can be picked.

—
isDateUnavailable(date: string) => boolean

Marks the days that show and cannot be picked.

—
disabledboolean

Turns off the whole calendar.

false
readonlyboolean

Shows the choice and refuses changes.

false
previousLabelstring

The name of the left arrow, read aloud.

'Previous month'
nextLabelstring

The name of the right arrow, read aloud.

'Next month'
aria-labelstring

What the day is for.

—
idstring

The id of the root.

—

It takes these props alone; class goes on the root.