Prop | Default | Type |
---|---|---|
as | 'div' | AsTag | Component The element or component this component should render as. Can be overwritten by |
asChild | boolean Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | |
defaultPlaceholder | DateValue The default placeholder date | |
defaultValue | DateRange The default value for the calendar | |
dir | 'ltr' | 'rtl' The reading direction of the date field when applicable. | |
disabled | false | boolean Whether or not the date field is disabled |
granularity | 'day' | 'hour' | 'minute' | 'second' The granularity to use for formatting times. Defaults to day if a CalendarDate is provided, otherwise defaults to minute. The field will render segments for each part of the date up to and including the specified granularity | |
hideTimeZone | boolean Whether or not to hide the time zone segment of the field | |
hourCycle | 12 | 24 The hour cycle used for formatting times. Defaults to the local preference | |
id | string Id of the element | |
isDateUnavailable | Matcher A function that returns whether or not a date is unavailable | |
locale | string The locale to use for formatting dates | |
maxValue | DateValue The maximum date that can be selected | |
minValue | DateValue The minimum date that can be selected | |
modelValue | DateRange | null The controlled checked state of the calendar. Can be bound as | |
name | string The name of the field. Submitted with its owning form as part of a name/value pair. | |
placeholder | DateValue The placeholder date, which is used to determine what month to display when no date is selected. This updates as the user navigates the calendar and can be used to programmatically control the calendar view | |
readonly | false | boolean Whether or not the date field is readonly |
required | boolean When | |
step | DateStep The stepping interval for the time fields. Defaults to |
Emit | Payload |
---|---|
update:modelValue | [DateRange] Event handler called whenever the model value changes |
update:placeholder | [date: DateValue] Event handler called whenever the placeholder value changes |
Slots (default) | Payload |
---|---|
modelValue | DateRange | null |
segments | { start: { part: SegmentPart; value: string; }[]; end: { part: SegmentPart; value: string; }[]; } |
Methods | Type |
---|---|
isDateUnavailable | Matcher A function that returns whether or not a date is unavailable |
setFocusedElement | (el: HTMLElement) => void |