Use Field to compose a label, helper text, and validation message around this control.
Usage
Type
Size
Appearance
With a prefix
+33
Allow reset
Error state
Incorrect value
Read-only state
Disabled state
Props
| Prop | Type | Default | Description |
|---|---|---|---|
type | 'text' | 'password' | 'email' | 'url' | 'number' | 'text' | Input type |
size | 'sm' | 'md' | 'lg' | 'md' | Size of the input |
appearance | 'secondary' | 'ghost' | 'secondary' | Visual style. Ghost removes the border and is suited for embedded search fields. |
placeholder | string | - | Placeholder text |
value | string | - | Input value |
disabled | boolean | false | Whether the input is disabled |
readOnly | boolean | false | Whether the input is read-only |
error | boolean | { message: string } | false | Error state or error message |
prefix | ReactNode | - | Content to display before the input |
suffix | ReactNode | - | Content to display after the input |
allowReset | boolean | false | Shows a reset button to clear the input |
onChange | (value: string, id?: string) => void | - | Callback when the value changes |