pub fn Input<T>(props: InputProps<T>) -> impl IntoViewwhere
T: Datatype,
Expand description
A component that renders an input field. It takes a datatype as a type parameter and automatically handles parsing and validation.
§Required Props
- label:
impl Into<TextProp>
- The label of the input field.
- bind:
impl Into<QueryStringPart>
- The query string that binds the input field to the form data.
§Optional Props
- placeholder:
impl Into<T>
- The placeholder text of the input field.
- value:
impl Into<MaybeProp<T>>
- The value of the input field.
- change: [
impl Into<Callback<Result<T, T::Error>, ()>>
](Callback<Result<T, T::Error>, ()>)- A write signal that is updated with the parsed value of the input field.
- error:
impl Into<MaybeProp<TextProp>>
- Set a custom error message for the input field.