Input
Text inputs collect user data. They support labels, helper text, error validation, icons, and disabled states.
Default
<Input
label="Email"
placeholder="you@example.com"
helperText="We will never share your email."
/>
Focused
Click the input below to see the focus glow effect.
Error
<Input
label="Username"
error="Username is already taken."
value="virgil"
/>
Disabled
<Input label="API Key" disabled value="sk-***" />
With Icon Prefix
<Input
label="Search"
placeholder="Search components..."
icon={<SearchIcon />}
/>
Props
| Prop | Type | Default | Description | Required |
|---|
| label | string | - | Label displayed above the input | No |
| placeholder | string | - | Placeholder text | No |
| helperText | string | - | Helper text below the input | No |
| error | string | - | Error message; applies red styling | No |
| disabled | boolean | false | Disables the input | No |
| icon | ReactNode | - | Icon rendered inside the input, before text | No |
| value | string | - | Controlled input value | No |
| onChange | (value: string) => void | - | Change handler | No |
Usage Guidelines
- Always provide a visible label for accessibility.
- Use helper text for formatting hints (e.g., "Must be at least 8 characters").
- Display error messages inline, directly below the input.
- Use the icon prefix for semantic hints like search or email fields.