Elements

Reference

Date Input

DateInput, dressed in the paper-and-ink system: a segmented field where the focused segment takes the flat ink fill. The parts — Root, Label, Control, SegmentGroup, Segment, SegmentContext, HiddenInput.

Root · Label · Control · SegmentGroup · Segment · HiddenInput

#Control

A styled part — no props of its own; it takes the anatomy's shared styling.

#HiddenInput

A styled part — no props of its own; it takes the anatomy's shared styling.

#Label

A styled part — no props of its own; it takes the anatomy's shared styling.

#Root

PropTypeDefaultDescription
sizeString as PropType<"sm" | "md" | "lg">"md"One rung of the control-height ladder for the segmented field.
allSegmentsdateInput.Props['allSegments']Whether to include all date/time segments based on the granularity.
defaultPlaceholderValuedateInput.Props['defaultPlaceholderValue']The initial placeholder date value when rendered.
defaultValuedateInput.DateValue[]The initial selected date(s) when rendered. Use when you don't need to control the selected date(s).
disabledbooleanWhether the date input is disabled.
formstringThe associate form of the hidden input element.
formatdateInput.Props['format']The format of the date to display in the input.
formatterdateInput.Props['formatter']The formatter used to format the date segments.
granularitydateInput.Props['granularity']The granularity of the date input.
hideTimeZonebooleanfalseWhether to hide the time zone segment when the value is a ZonedDateTime.
hourCycledateInput.Props['hourCycle']The hour cycle used for formatting time segments.
idstringThe unique identifier of the machine.
idsdateInput.Props['ids']The ids of the elements in the date input. Useful for composition.
invalidbooleanWhether the date input is invalid.
localestring"en-US"The locale (BCP 47 language tag) to use when formatting the date.
maxdateInput.DateValueThe maximum date that can be selected.
mindateInput.DateValueThe minimum date that can be selected.
modelValuedateInput.DateValue[]The v-model value of the date input.
namestringThe name attribute of the hidden input element.
placeholderValuedateInput.Props['placeholderValue']The placeholder date value used to generate placeholder segments.
readOnlybooleanWhether the date input is read-only.
requiredbooleanWhether the date input is required.
selectionModedateInput.SelectionMode"single"The selection mode of the date input. - single - only one date can be selected - range - a range of dates can be selected
shouldForceLeadingZerosbooleanWhether to force leading zeros for numeric segments.
timeZonestring"UTC"The time zone to use.
translationsdateInput.Props['translations']The localized messages to use.
valuedateInput.DateValue[]The controlled selected date(s).
EventPayload
focusChangedetails: FocusChangeDetails
valueChangedetails: ValueChangeDetails
update:modelValuevalue: DateValue[]
placeholderChangedetails: PlaceholderChangeDetails
update:placeholderValueplaceholderValue: DateValue

#SegmentContext

A styled part — no props of its own; it takes the anatomy's shared styling.

#SegmentGroup

A styled part — no props of its own; it takes the anatomy's shared styling.

#Segment

A styled part — no props of its own; it takes the anatomy's shared styling.