Skip to content

Input

Free

A field for one line of text, such as a name or an email address. It comes in the 3 sizes of Button, with invalid, disabled, and read-only states.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Put the Input in a Field with a FieldLabel, so the label and the error link to it. size is the height (sm 28, default 32, lg 36px), not the native size attribute.

The sample also uses Field. One command adds them with this item:

workspace-url-field.tsx

Input

<input>
PropTypeDefaultDescription
rounded"default""full"—
size"default""lg""sm""xs"—
surface"default""group""plain"—
classNamestring—
From Base UIInputBase UI docs
onValueChange—Callback fired when the value changes. Use when controlled.
defaultValuestring | number | readonly string[]—The default value of the input. Use when uncontrolled.
valuestring | number | readonly string[]—The value of the input. Use when controlled.
...props<input> attributes—Every other attribute goes to the <input>, with a ref.
  • Use it for one line of text: an email address, a name, a URL.
  • Put it in a Field for its label, description, and error.
  • Set size (28, 32, or 36px) to match the Button next to it. Set the width with className.
  • For a one-time code, use Input OTP.
  • For many lines of text, use a multi-line text field, not an Input.

Input is a Base UI Input, a native <input>. In a Field, FieldLabel names it, and Base UI links the help and the error with aria-describedby.

An invalid field (aria-invalid) shows a red edge and ring. Focus shows a 3px ring. A read-only field gets a muted fill.

The text stays 14px on phones. Add the ios-viewport script to the document head, so iOS does not zoom into a focused field.

  1. AddedInput.
Open the release