Single-line text field on the container surface; invalid wires the error state.
Anatomy
┌ placeholder / value ────────┐
└─────────────────────────────┘ ← container bg, hairline border,
sell border when invalidProps
| Prop | Type | Default | Notes | ||
|---|---|---|---|---|---|
size | "sm" | "md" \ | "lg"` | "md" | Heights 28 / 36 / 44 px (shared scale). |
invalid | boolean | false | Sets aria-invalid + sell border. Put the error text next to the field and link via aria-describedby. | ||
className | string | — | cn-merged. | ||
| …rest | InputHTMLAttributes | — | Native pass-through (value, onChange, type…). |
Motion
Border/background transition 150ms, targeted properties only.
A11y
- · Always label it: visible
<label htmlFor>oraria-labelfrom the caller. - ·
invalidsetsaria-invalid; pair with a visible message viaaria-describedby— errors appear next to where the action happens. - · Paste is never blocked.