Calendar
Data inputA month calendar to pick a date: type="single" binds a DateValue (a CalendarDate from @limerdev/zest/date, all of @internationalized/date), type="multiple" a DateValue[]. minValue, maxValue, isDateDisabled, isDateUnavailable, numberOfMonths, weekStartsOn, locale. With no children it draws the header and month grids; the parts (Header, Heading, PrevButton, NextButton, Months, Grid, GridHead, GridBody, GridRow, HeadCell, Cell, Day) are there for custom layouts. Arrow keys move between days, Page Up and Down between months, Enter or Space picks.
import { Calendar } from '@limerdev/zest'; DatePicker puts it in a popover.DateField. A range of dates: use RangeCalendar.Examples
Basic
A single date. Arrow keys move between days, Page Up and Down between months.
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
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 | 31 | 1 | 2 |
Picked: 2026-12-03
<script lang="ts">
import { Calendar, getLocalTimeZone, today, type DateValue } from '@limerdev/zest';
let date: DateValue | undefined = $state(today(getLocalTimeZone()));
</script>
<div class="grid justify-items-center gap-2">
<Calendar.Root
type="single"
bind:value={date}
class="rounded-box border-(length:--border) border-border bg-base-100 shadow-field"
/>
<p class="text-sm text-muted">Picked: {date?.toString() ?? 'nothing'}</p>
</div> Two months and limits
numberOfMonths shows several; minValue and isDateUnavailable limit the choice. Date helpers such as isWeekend come from @limerdev/zest/date, all of @internationalized/date.
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
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 | 31 | 1 | 2 |
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 31 | 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 | 1 | 2 | 3 | 4 | 5 | 6 |
<script lang="ts">
import { Calendar } from '@limerdev/zest';
import { getLocalTimeZone, isWeekend, today, type DateValue } from '@limerdev/zest/date';
const start = today(getLocalTimeZone());
let date: DateValue | undefined = $state();
</script>
<Calendar.Root
type="single"
bind:value={date}
numberOfMonths={2}
minValue={start}
isDateUnavailable={(value) => isWeekend(value, 'en-GB')}
class="rounded-box border-(length:--border) border-border bg-base-100 shadow-field"
/> Props
Every part also takes class (merged over its defaults), ref (bindable: the element), children, and child (a snippet that
renders your own element, with props to spread on it).
Calendar.Root
| Prop | Type | Default | Description |
|---|---|---|---|
| calendarLabel | string | – | This label is exclusively used for accessibility, remaining hidden from the page. It's read by screen readers when the calendar is opened. The current month and year are automatically appended to the label, so you only need to provide the base label. For instance: - 'Date of birth' will be read as 'Date of birth, January 2021' if the current month is January 2021. - 'Appointment date' will be read as 'Appointment date, January 2021' if the current month is January 2021. - 'Booking date' will be read as 'Booking date, January 2021' if the current month is January 2021. |
| disabled | boolean | false | Whether or not the calendar is disabled. |
| disableDaysOutsideMonth | boolean | false | Whether to disable the selection of days outside the current month. By default, days outside the current month are rendered to fill the calendar grid, but they are not selectable. Setting this prop to true will disable this behavior. |
| fixedWeeks | boolean | false | Display 6 weeks per month, regardless the month's number of weeks. This is useful for displaying a consistent calendar, where the size of the calendar doesn't change month to month. To display 6 weeks per month, you will need to render out the previous and next month's dates in the calendar as well. |
| initialFocus | boolean | – | If true, the calendar will focus the selected day, today, or the first day of the month in that order depending on what is visible when the calendar is mounted. |
| isDateDisabled | DateMatcher | – | A function that receives a date and returns true or false to indicate whether the date is disabled. |
| isDateUnavailable | DateMatcher | – | Dates matching the provided matchers are marked as "unavailable." Unlike disabled dates, users can still focus and select unavailable dates. However, selecting an unavailable date renders the date picker as invalid. For example, in a calendar for booking appointments, you might mark already booked dates as unavailable. These dates could become available again before the appointment date, allowing users to select them to learn more about the appointment. [data-unavailable] - applied to unavailable dates |
| locale | string | 'en' | The default locale setting. |
| maxDays | number | undefined | The maximum number of days that can be selected in multiple mode. When set, users cannot select more dates than this number. |
| maxValue | DateValue | – | The maximum date that can be selected in the calendar. |
| minValue | DateValue | – | The minimum date that can be selected in the calendar. |
| monthFormat | "numeric" | "long" | "short" | "narrow" | "2-digit" | ((month: number) => string) | "long" | The format of the month names in the calendar. |
| numberOfMonths | number | 1 | Determines the number of months to display on the calendar simultaneously. For navigation between months, refer to the pagedNavigation prop. |
| onPlaceholderChange | OnChangeFn<DateValue> | – | A callback function called when the placeholder value changes. |
| onValueChange | OnChangeFn<DateValue | undefined> | OnChangeFn<DateValue[]> | – | A callback function called when the value changes. |
| pagedNavigation | boolean | false | Applicable only when numberOfMonths is greater than 1. Controls whether to use paged navigation for the next and previous buttons in the date picker. With paged navigation set to true, clicking the next/prev buttons changes all months in view. When set to false, it shifts the view by a single month. For example, with pagedNavigation set to true and 2 months displayed (January and February), clicking the next button changes the view to March and April. If pagedNavigation is false, the view shifts to February and March. |
| placeholder bindable | DateValue | the current date | The placeholder date, used to control the view of the calendar when no value is present. |
| preventDeselect | boolean | false | Whether or not users can deselect a date once selected without selecting another date. |
| readonly | boolean | false | Whether the calendar is readonly. When true, the user will be able to focus and navigate the calendar, but will not be able to select dates. |
| type required | "multiple" | "single" | – | The type of calendar. If set to 'single', the calendar will only allow a single date to be selected. If set to 'multiple', the calendar will allow multiple dates to be selected. |
| value bindable | DateValue | DateValue[] | – | The value of the selected date in the calendar. The value of the selected dates in the calendar. |
| weekdayFormat | "long" | "short" | "narrow" | 'short' | How the string representation of the weekdays provided via the weekdays state store should be formatted. md - "long": "Sunday", "Monday", "Tuesday", etc. - "short": "Sun", "Mon", "Tue", etc. - "narrow": "S", "M", "T", etc. |
| weekStartsOn | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 0 (Sunday) | The day of the week to start the calendar on, which must be a number between 0 and 6, where 0 is Sunday and 6 is Saturday. |
| yearFormat | "numeric" | "2-digit" | ((year: number) => string) | "numeric" | The format of the year names in the calendar. |
Calendar.Header
No props of its own beyond the common ones.
Calendar.Heading
No props of its own beyond the common ones.
Calendar.PrevButton
No props of its own beyond the common ones.
Calendar.NextButton
No props of its own beyond the common ones.
Calendar.Months
No props of its own beyond the common ones.
Calendar.Grid
No props of its own beyond the common ones.
Calendar.GridHead
No props of its own beyond the common ones.
Calendar.GridBody
No props of its own beyond the common ones.
Calendar.GridRow
No props of its own beyond the common ones.
Calendar.HeadCell
No props of its own beyond the common ones.
Calendar.Cell
| Prop | Type | Default | Description |
|---|---|---|---|
| date required | DateValue | – | The date value of the cell. |
| month required | DateValue | – | The month DateValue that this cell is being rendered in. |
Calendar.Day
No props of its own beyond the common ones.