Components
Text Input
Single-line field: a translucent grey box with a hairline ring that turns blue on focus and red when invalid. Optional leading icon and trailing content.
Usage
Use it to:
- short free text: names, emails, URLs, amounts with a unit
- inline filters (or SearchInput)
Don’t use it to:
- long text (use Textarea)
- picking from known values (use Select / Combobox)
- numbers with steppers (use NumberInput)
Installation
Install the package (React 19):
terminal
terminal
terminal
Import the styles once, in your app entry or root layout:
/src/main.tsx
Use it anywhere inside your app's <Theme> (see Installation):
/src/TextInputExample.tsx
Examples
Size
Icon and trailing content
States
Dark theme
API Reference
TextInput
The ref and all other <input> props go to the <input>; className / style style the box. Adds:
| Prop | Type | Default |
|---|---|---|
invalid | boolean | false |
disabled | boolean | false |
required | boolean | false |
name | string | |
size | "sm""md""lg" | "md" |
icon | IconName | |
trailing | ReactNode | |
inputClassName | string |
Accessibility
- A native
<input>: every keyboard behaviour is the browser’s. The ring on the box shows focus. - It has no visible label of its own: wrap it in Field (which wires
id,aria-describedbyandaria-invalid) or passaria-label. A placeholder is not a label. invalidsetsaria-invalid; describe the error in text (Field’serror), not only by color.
© 2026 Motion. Internal documentation.