Calendar

A date calendar for selecting a single date or multiple dates. Compound component using dot notation.

Example

Selected: 2026-04-03

Root Props

PropTypeDefaultDescription
type'single' | 'multiple''single'Selection mode
valueDateValue | DateValue[]Selected date(s), bindable
onValueChange(value) => voidCalled when selection changes
placeholderDateValueControls visible month, bindable
minValueDateValueMinimum selectable date
maxValueDateValueMaximum selectable date
disabledbooleanfalseDisable the calendar
readonlybooleanfalsePrevent date selection
preventDeselectbooleanfalsePrevent clearing selection
numberOfMonthsnumber1Months shown at once
pagedNavigationbooleanfalseNavigate by full page of months
weekStartsOn0 | 1 | 2 | 3 | 4 | 5 | 60First day of week (0 = Sunday)
weekdayFormat'long' | 'short' | 'narrow''narrow'Weekday header format
isDateDisabledDateMatcherFunction to disable specific dates
isDateUnavailableDateMatcherFunction to mark dates unavailable
fixedWeeksbooleanfalseAlways show 6 weeks
localestring'en'Locale for formatting
calendarLabelstringAccessible label
initialFocusbooleanfalseFocus calendar on mount
classstringAdditional CSS classes

Sub-components

ComponentDescription
Calendar.HeaderContainer for navigation controls
Calendar.HeadingDisplays current month/year
Calendar.PrevButtonNavigate to previous month
Calendar.NextButtonNavigate to next month
Calendar.GridTable wrapper for a month grid
Calendar.GridHeadTable header for weekday labels
Calendar.HeadCellIndividual weekday label cell
Calendar.GridBodyTable body containing date rows
Calendar.GridRowA row of date cells
Calendar.CellContainer for a single day (requires date and month props)
Calendar.DayRenders the day number button

Usage

<script>
  import { Calendar } from '@chrissnell/chonky-ui';
  import { CalendarDate } from '@internationalized/date';

  let value = $state(new CalendarDate(2026, 4, 3));
</script>

<Calendar.Root bind:value>
  {#snippet children({ months, weekdays })}
    <Calendar.Header>
      <Calendar.PrevButton>&larr;</Calendar.PrevButton>
      <Calendar.Heading />
      <Calendar.NextButton>&rarr;</Calendar.NextButton>
    </Calendar.Header>
    {#each months as month}
      <Calendar.Grid>
        <Calendar.GridHead>
          <Calendar.GridRow>
            {#each weekdays as day}
              <Calendar.HeadCell>{day}</Calendar.HeadCell>
            {/each}
          </Calendar.GridRow>
        </Calendar.GridHead>
        <Calendar.GridBody>
          {#each month.weeks as week}
            <Calendar.GridRow>
              {#each week as date}
                <Calendar.Cell {date} month={month.value} />
              {/each}
            </Calendar.GridRow>
          {/each}
        </Calendar.GridBody>
      </Calendar.Grid>
    {/each}
  {/snippet}
</Calendar.Root>