DateInput()function
DateInput({
name,
title = "",
placeholder = title, // Placeholder must be defined or `:placeholder-shown` CSS rules won't show.
required = false,
disabled = false,
message = "",
value,
onValue,
min,
max,
input = "date",
step,
...variants
}: DateInputProps): ReactElement| Param | Type | |
|---|---|---|
variants | DateInputProps | Props for DateInput, a date/time <input> that emits an ISO string value. required |
.min | PossibleDate | Values that can be converted to dates. |
.max | PossibleDate | Values that can be converted to dates. |
.input | DateInputType | type="" prop for HTML <input /> tags that are relevant for dates. |
.step | number |
| Return | |
|---|---|
ReactElement | A native date/time <input> element. |
Date, time, or datetime input that accepts a PossibleDate and emits an ISO string value.
- The
inputprop selects the underlying<input type="date|time|datetime-local">and matching string format.
Examples
<DateInput name="dob" input="date" value={dob} onValue={setDob} />