Marker

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

Alone, with an aria-label
Sizes beside a Button
Read-only
Disabled
Invalid, aloneRare: an invalid input needs a message, which a Field gives it.

Props

PropTypeDefaultDescription
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".
readOnlybooleanDefault falseFocusable and copyable, not editable. Dashed edge, full-contrast text.
disabledbooleanDefault falseUnavailable. Inside a Field, set disabled on Field.Root instead.
aria-invalidbooleanDefault –Alone only. Inside a Field, set invalid on Field.Root, which also shows the error.
classNamestringDefault –Places and sizes the input, such as a width. The input fills its container by default.
…input propsDefault –value, defaultValue, onValueChange, name, required, placeholder, inputMode, autoComplete, ref and the rest of <input>.