Skip to content

Calendar

Navigate a date grid, skip unavailable days, and select a civil date.

Usage

Month

Navigate and select dates in a complete month grid.

Navigate and select dates in a complete month grid.

August 2026No date selected

Week

Switch to a focused seven-day view while keeping selection and paging available.

Switch to a focused seven-day view while keeping selection and paging available.

August 2026No date selected

Disabled weekends

Keep weekend dates visible while preventing them from becoming the selected date.

Keep weekend dates visible while preventing them from becoming the selected date.

August 2026No date selected

Controlled

Let the parent own the current value and apply accepted changes back to the component.

Let the parent own the current value and apply accepted changes back to the component.

August 2026No date selected

API

Vue package: @sectile/vue/temporal/calendar

Components
  • CalendarRoot
  • CalendarContent
  • CalendarGrid
  • CalendarCell
  • CalendarMonthCell
  • CalendarInput
  • CalendarPreviousWeek
  • CalendarNextWeek
  • CalendarPreviousMonth
  • CalendarNextMonth
  • CalendarPreviousYear
  • CalendarNextYear
  • CalendarWeekViewTrigger
  • CalendarMonthViewTrigger
  • CalendarYearViewTrigger

Props

CalendarRootProps

defaultHighlightedValue

Initially highlighted value for uncontrolled state.

defaultValue

Initial value used when the component owns its state.

defaultView

Initial calendar or picker view.

disabled

Whether interaction is unavailable.

highlightedValue

Value currently highlighted for keyboard interaction.

label

Accessible name announced for the control.

modelValue

Current value when state is controlled by the parent.

policies

Behavior policies that customize validation, movement, or selection.

readonly

Whether the value can be inspected but not changed.

referenceDate

Deterministic civil date used when a calendar has no selected or highlighted value.

required

Whether the control must contain a valid value before submission.

CalendarCellProps

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

value

Current value exposed by this contract.

CalendarMonthCellProps

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

value

Current value exposed by this contract.

CalendarPartProps

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

Slots

CalendarRootSlotProps

dates

Dates projected by the active view.

disabled

Whether interaction is unavailable.

highlightedValue

Value currently highlighted for interaction.

months

Months projected by the active view.

readonly

Whether the value can be inspected but not changed.

value

Current value exposed by this contract.

view

Current calendar anchor.

viewMode

Active calendar view mode.

CalendarCellSlotProps

disabled

Whether interaction is unavailable.

highlighted

Whether this item is highlighted for interaction.

inRange

Whether this value lies inside the selected range.

outsideMonth

Whether this date belongs to an adjacent month.

selected

Whether this item is selected.

value

Current value exposed by this contract.

CalendarMonthCellSlotProps

disabled

Whether interaction is unavailable.

highlighted

Whether this item is highlighted for interaction.

inRange

Whether this value lies inside the selected range.

selected

Whether this item is selected.

value

Current value exposed by this contract.

Events

CalendarRoot

update:highlightedValue

Emitted when the requested highlighted value changes.

update:modelValue

Emitted when the component requests a new controlled value.

Other types

CalendarValueChangeHandler

ts
type CalendarValueChangeHandler = NonNullable<InstanceType<typeof CalendarRoot>['$props']['onUpdate:modelValue']>

CalendarHighlightedValueChangeHandler

ts
type CalendarHighlightedValueChangeHandler = NonNullable<InstanceType<typeof CalendarRoot>['$props']['onUpdate:highlightedValue']>

CalendarMonthValue

NameTypeRequired
yearnumberYes
monthnumberYes

CalendarPolicies

NameTypeRequired
minDateValue
maxDateValue
requiredboolean
unavailable(value: DateValue) => boolean
weekStartsOn1 | 2 | 3 | 4 | 5 | 6 | 7
maxScannumber

CalendarViewMode

ts
type CalendarViewMode = 'week' | 'month' | 'year'

DateValue

NameTypeRequired
yearnumberYes
monthnumberYes
daynumberYes

Parts

Shared scope: [data-scope="calendar"]. Combine it with a part selector to keep styles local to this component.

PartSelectorRoleExtra attributes
content[data-part="content"]Contains the component content shown for the active state.
input[data-part="input"]Keeps the selected date available for native form submission.
week-view-trigger[data-part="week-view-trigger"]Switches the calendar to the week view.
month-view-trigger[data-part="month-view-trigger"]Switches the calendar to the month view.
year-view-trigger[data-part="year-view-trigger"]Switches the calendar to the year view.
previous-week[data-part="previous-week"]Moves to the previous week.
next-week[data-part="next-week"]Moves to the next week.
previous-month[data-part="previous-month"]Moves to the previous month.
next-month[data-part="next-month"]Moves to the next month.
previous-year[data-part="previous-year"]Moves to the previous year.
next-year[data-part="next-year"]Moves to the next year.
grid[data-part="grid"]Groups cells into a navigable two-dimensional structure.
cell[data-part="cell"]Represents one navigable or selectable grid value.
month-cell[data-part="month-cell"]Represents one selectable month.

Keyboard interaction

KeyBehavior
Arrow Left / Arrow RightMove by one day.
Arrow Up / Arrow DownMove by one week.
Home / EndMove to the start or end of the week.
Page Up / Page DownMove by one month; hold Shift to move by one year.
Enter / SpaceSelect the highlighted date.

Accessibility

The inline content owns a labeled grid whose cells expose selected, highlighted, unavailable, and outside-month state.

See the corresponding WAI-ARIA pattern for the host accessibility contract.

Released under the MIT License.