Input
A labelled text field with focus, disabled and error states. Any native input attribute is forwarded.
Examples
Basic
Show code
<Input label="Email" type="email" placeholder="you@example.com" />Error
Enter a valid email
Show code
<Input label="Email" error="Enter a valid email" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Visible label text. The input is wrapped in a label, so the association is automatic. |
error | string | — | When set, the field takes the danger tone, the input is marked aria-invalid, and the message shows below it. |
Any other attribute — type, placeholder, name, value, oninput — is spread
onto the <input>.