Skip to content

BaseDateInput

Form Input Field Component for Date, Date - Date, Date - Time, or Time - Time

for date also a format switch between date | year is available

Props

Prop nameDescriptionTypeValuesDefault
dateTypeselect date or datetime or a rangestringdaterange, datetime, single, timerange'single'
modelValueinput field settable from outside.
attention: if this is an object it needs to contain all the
properties (e.g. date_from, time_to) already otherwise only
a string will be returned
object|string|date-
labellabel for input field, required for usability purposes, handle
showing of label with property showLabel
string-
showLabeldefines if input label should be visibleboolean-true
placeholderset a placeholder for the input field (object with date and time attribute respectively)object|string-() => ({ date: 'Select Date', time: 'Select Time' })
rangeSeparatordefine the range separatorstring-'–'
formatspecify date format.

date_year: display tabs that allow for toggle between only choosing year
or complete date
date_month_year: display tabs that allow for toggle between choosing only year,
year and month or complete date
stringday, month, year, date_year, date_month_year'day'
dateFormatLabelsspecify labels displayed instead of 'DD.MM.YYYY' and 'YYYY'
should have the form { date: 'xxx', month: 'zzz', year: 'yyy' }
object-{
date: 'DD.MM.YYYY',
month: 'MM.YYYY',
year: 'YYYY'
}
formatTabsLegenda legend for the date format switch buttonsstring-'Switch between date formats'
languageset calendar language (ISO 639-1).
caveat: currently only en, de and fr are supported
stringde, en, fr'en'
inputIdset idnumber|string-''
useFormFieldStylingdefine if standard form field styling should be
used (otherwise no border, no box shadow)
boolean-true
showInputBorderoption to have the border of the input field not displayedboolean-true
requiredmark as required field (currently only used for aria-required)
this can be a string displayed in all fields or specific for one field
(key same as for modelValue object)
boolean|object-false
invalidmark the form field as invalid and ideally also provide an error message
to display below the form field
for an example see BaseInput
this can be a string displayed in all fields or specific for one field
(key same as for modelValue object)
boolean|object-false
disabledset true if input field should be disabled
for an example see BaseInput
this can be a string displayed in all fields or specific for one field
(key same as for modelValue object)
boolean|object-false
errorMessageadd an error message to be displayed below form field if field is invalid
for an example see BaseInput
this can be a string displayed in all fields or specific for one field
(key same as for modelValue object)
string|object-''
showErrorIcondefine if error icon should be shown
for an example see BaseInput
boolean-true
clearableif true a remove icon will be shown allowing to remove
all input at once
for an example see BaseInput
boolean-false
inputClassspecify additional input field stylingstring-''
setFocusOnActiveuse this prop to deactivate automatic setting of focus as soon as input element
becomes active - this might require external handling of focus setting!
boolean-true
isActivein order to be able to set input field active state from outsideboolean-false
isActiveDelayuse this prop to set a delay in ms before calender is displayednumber-0
inputTypespecify input field type for the native HTML <input> elementstringtext, search'text'
assistiveTextprovide assistive text for screen readers
clearInput: text read for remove input icon if prop clearable is set true
this could either be just one string that is used for all fields or an object with
field specific text
object-{
clearInput: {
date_from: 'Clear input from',
date_to: 'Clear input to',
time_from: 'Clear input from',
time_to: 'Clear input to',
date: 'clear date',
time: 'clear time',
}
}

Events

Event namePropertiesDescription
click-input-field
update:model-value
clicked-outside
value-validatedundefined string, Object - the validated string or input objectthis event is emitted when the value was validated in case input should just be considered
after date validation
inputundefined string - the input event value howeverEvent emitted on input, passing input string
update:is-active

Slots

NameDescriptionBindings
label-additionto add additional elements to the label row
pre-input-fieldto add elements within form field but before the input element line for an example see BaseInput
input-field-addition-beforeadd elements within input form field but before all other elements - this field wraps if necessary for an example see BaseInput
input-field-inline-beforeadd elements directly in the input line (no wrapping) for an example see BaseInput
post-input-fieldfor adding elements after input
below-inputto add elements below input fields e.g. add drop down

Demo

Date range input fields


Single date input with format 'date_month_year', enabling switching the format

Date Time Input