TextInputField
A labelled text input with optional error message. Composes a <label> and <input> with correct for/id association automatically.
Default
<TextInputField label="Project name" name="name" type="text" /> With error
Error: Please enter a valid email address.
<TextInputField label="Email" name="email" type="email" error="Please enter a valid email address." /> Props
| Prop | Type | Description |
|---|---|---|
label | string | Visible label text. Also used as accessible name. |
name | string | Form field name. Also used to generate the id/for association. |
error | string | Validation error message. Renders below the input with role="alert". |
...props | InputHTMLAttributes | All native input attributes (type, autoComplete, defaultValue, …). |