Input
Inputs collect structured user information for forms and inline editing. Use clear labels and validation hints to reduce user errors.
Input
Password must be at least 8 characters.
Features
- Floating labels for compact, readable form layouts.
- Built-in error messaging and invalid state styling.
- Supports native attributes for validation and behavior.
- Consistent spacing, typography, and semantic token usage.
When to use
Accessibility
Best Practices
Use Specific Field Labels
Write labels like 'Email address' or 'Account number' so users immediately know what format or value is expected.
Keep Validation Close
Show validation guidance and errors directly beneath the field so people can correct issues without scanning the page.
Choose the Right Input Type
Use native types such as 'email', 'password', or 'number' to support better keyboards, autofill, and built-in browser behavior.
Use Textarea for Longer Responses
Keep Input focused on short, single-line values and move comments, notes, or descriptions to Textarea.
Use Vague Labels
Avoid labels like 'Info' or 'Details' because they force users to guess what should be entered.
Rely on Placeholder Text Alone
Do not place essential instructions only in placeholder text because it disappears once the field has content.
Show Premature Errors
Avoid displaying an error state before the user has had a reasonable chance to interact with the field.
Force Long Content Into One Line
Do not use a single-line input for messages, descriptions, or other extended responses.
Hide Validation Rules Elsewhere
Keep important format rules and constraints near the field instead of burying them in distant helper text.
Props API
| Name | Type | Description |
|---|---|---|
| label | string | Visible floating label and default placeholder text. |
| error | string | Shows validation message and error styles when provided. |
| type | string | Native input type such as text, email, password, and number. |
| id | string | Optional explicit ID used to connect the input, label, and error message. |
| ...props | React.InputHTMLAttributes<HTMLInputElement> | Supports native input attributes like required, disabled, autoComplete, defaultValue, and name. |