Input
Collect a single line of text.
Usage
Keep labels visible. Explain constraints before submission and connect error messages to their input.
Accessibility
Pair htmlFor and id. Use aria-invalid for errors and aria-describedby for hints. A placeholder is not a replacement for a label. Keep leadingIcon decorative. Pass null to remove a dynamic icon while keeping the input focused.
| Property | Type | Default |
|---|---|---|
| type | Native HTML input type | text |
| disabled / readOnly | boolean | false |
| aria-invalid | boolean | None |
| leadingIcon | ReactNode | None |
| ref | HTMLInputElement | None |
<label htmlFor="project">Project name</label>
<Input id="project" placeholder="Your next idea"
aria-describedby="project-hint"
leadingIcon={
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinejoin="round">
<path d="M3 6h6l2 2h10v11H3z" />
</svg>
} />
<p id="project-hint">Use a short, memorable name.</p>