| Prop | Default | Type |
|---|---|---|
allowNonContiguousRanges | false | booleanWhen combined with |
as | 'div' | AsTag | ComponentThe element or component this component should render as. Can be overwritten by |
asChild | booleanChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | |
calendarLabel | stringThe accessible label for the calendar | |
defaultPlaceholder | DateValueThe default placeholder date | |
defaultValue | { start: undefined, end: undefined } | DateRangeThe default value for the calendar |
dir | 'ltr' | 'rtl'The reading direction of the calendar when applicable. | |
disabled | false | booleanWhether or not the calendar is disabled |
fixedDate | 'start' | 'end'Which part of the range should be fixed | |
initialFocus | false | booleanIf true, the calendar will focus the selected year on mount |
isYearDisabled | MatcherA function that returns whether or not a year is disabled | |
isYearUnavailable | MatcherA function that returns whether or not a year is unavailable | |
locale | stringThe locale to use for formatting dates | |
maximumYears | numberThe maximum number of years that can be selected in a range | |
maxValue | DateValueThe maximum date that can be selected | |
minValue | DateValueThe minimum date that can be selected | |
modelValue | DateRange | nullThe controlled checked state of the calendar. Can be bound as | |
nextPage | ((placeholder: DateValue) => DateValue)A function that returns the next page of the calendar. | |
placeholder | DateValueThe placeholder date, which is used to determine what year range to display when no date is selected. | |
preventDeselect | false | booleanWhether or not to prevent the user from deselecting a date without selecting another date first |
prevPage | ((placeholder: DateValue) => DateValue)A function that returns the previous page of the calendar. | |
readonly | false | booleanWhether or not the calendar is readonly |
yearsPerPage | 12 | numberNumber of years to display per page |
| Emit | Payload |
|---|---|
update:modelValue | [date: DateRange]Event handler called whenever the model value changes |
update:placeholder | [date: DateValue]Event handler called whenever the placeholder value changes |
update:startValue | [date: DateValue]Event handler called whenever the start value changes |
| Slots (default) | Payload |
|---|---|
date | DateValueThe current date of the placeholder |
grid | Grid<DateValue>The grid of years |
locale | stringThe calendar locale |
modelValue | DateRangeThe current date range |
| Methods | Type |
|---|---|
isYearDisabled | MatcherA function that returns whether or not a year is disabled |
isYearUnavailable | MatcherA function that returns whether or not a year is unavailable |
