Calendar

An enhanced calendar with a custom month/year selector. Click on the month to access the month/year picker view.

Import

Usage

Single Date

Date Range

Multiple Dates

Disabled Dates

Date Constraints

Week Numbers

06
07
08
09

Data Attributes

  • -
    data-slot="calendar"Main calendar element identifier
  • -
    data-slot="month-year-picker"Month/year picker view identifier

Accessibility

Keyboard Support

  • -
    Arrow KeysNavigate between days
  • -
    Page UpGo to previous month
  • -
    Page DownGo to next month
  • -
    HomeGo to start of week
  • -
    EndGo to end of week
  • -
    Enter / SpaceSelect the focused date
  • -
    TabMove focus to next focusable element

ARIA Attributes

  • -
    role='grid'Applied to the calendar table for proper grid navigation
  • -
    aria-labelDescribes the calendar purpose for screen readers
  • -
    aria-selectedIndicates the selected date(s)
  • -
    aria-disabledSet on disabled dates

Calendar Props

AttributeTypeDefaultDescription
mode'single' | 'multiple' | 'range''single'Selection mode for the calendar.
selectedDate | Date[] | DateRange | undefined-The selected date(s).
onSelect(date: Date | Date[] | DateRange | undefined) => void-Callback when date selection changes.
showOutsideDaysbooleantrueWhether to show days from adjacent months.
showWeekNumberbooleanfalseWhether to show week numbers.
disabledMatcher | Matcher[]-Dates that should be disabled. Can be a Date, array of Dates, { dayOfWeek: number[] }, { before: Date }, { after: Date }, or a function (date) => boolean.
startMonthDate-The earliest month the user can navigate to.
endMonthDate-The latest month the user can navigate to.
monthDate-Control the displayed month (controlled mode).
onMonthChange(date: Date) => void-Callback when the displayed month changes.
buttonVariant'default' | 'bordered' | 'light' | 'ghost' | 'ethereal''ghost'Variant for the navigation buttons.
numberOfMonthsnumber1Number of months to display at once.