Primitive
Input
One line of text.
When to use
Put it in a Field when it has a visible label, which is almost always; alone it needs an aria-label. Long text is a TextArea, choosing from options a Select or Combobox.
States
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "md" | "lg" | Default "md" | md (32px) beside a default Button, in toolbars and table rows; lg (40px) in a form. |
| type | "text" | "email" | "password" | "search" | "tel" | "url" | Default "text" | No "number": it changes on scroll and drops leading zeros. Use "text" with inputMode="numeric" or "decimal". |
| readOnly | boolean | Default false | Focusable and copyable, not editable. Dashed edge, full-contrast text. |
| disabled | boolean | Default false | Unavailable. Inside a Field, set disabled on Field.Root instead. |
| aria-invalid | boolean | Default – | Alone only. Inside a Field, set invalid on Field.Root, which also shows the error. |
| className | string | Default – | Places and sizes the input, such as a width. The input fills its container by default. |
| … | input props | Default – | value, defaultValue, onValueChange, name, required, placeholder, inputMode, autoComplete, ref and the rest of <input>. |