When to use
- Names and identifiers
- Short descriptions
- Search terms
- Single-line user input
Text inputs collect short, free-form values. They work best when the user knows the answer and the system gives enough context to enter it correctly.
Start here before choosing examples or props. These notes explain where Text Input helps, where another pattern is better, and what should stay true in product work.
import { TextInput } from '@/components/ui/TextInput';Label, helper, and error wire to the input via id and aria-describedby automatically.
Text inputs need clear state changes without layout shift. Focus should be obvious, conventional, and stable; validation should be direct and recoverable.
Use your legal first and last name.
Ready for user input with a visible label and optional helper text.
Format: name@example.com
Shows a clear focus ring so the active field is easy to track.
Enter an email address that includes @ and a domain.
Names the problem and tells the user exactly how to fix it.
This value is managed by People Operations.
Unavailable because the field is not relevant or cannot be edited in this state.
The visual pieces and the semantic pieces need to stay connected. Helper text and error text should be associated with the field, not simply placed nearby.
Use a short title people can recognize in approvals.
The component accepts every native HTMLInputElement attribute on top of the design system props below.
| Prop | Type | Default | Description |
|---|---|---|---|
label | ReactNode | — | Visible label rendered above the input. Required for accessibility. |
helper | ReactNode | — | Guidance text below the input. Auto-wired to aria-describedby. |
error | ReactNode | — | Error message. Replaces helper text and sets aria-invalid on the input. |
Labels persist above the field so users always know what the value means, even after typing.
Placeholder text disappears when users type and creates memory load, especially in longer forms.
Use helper text for expected formats, constraints, and examples when users need guidance.
Validate on blur and submit so users can recover close to the field that needs attention.
What Text Input does not do yet, and what consumers need to compose themselves.
Agents should treat labels, helper text, error recovery, and autocomplete as part of the component contract, not optional polish.
import { TextInput } from '@/components/ui/TextInput';
<TextInput
label="Vendor email"
name="vendorEmail"
type="email"
autoComplete="email"
helper="Format: name@example.com"
/>Inputs should not animate. Use a stable border and focus ring to show the active field without moving the control, shifting text, or introducing unexpected motion into forms.