React Input

The text-entry foundation: Input with optional leading/trailing adornments (icons, static prefixes, kbd hints), Textarea, and the Field wrapper that wires label, help text, and error message together with correct ARIA. Error state colors the border, ring, and message — and the message replaces the help text, so the layout never jumps.

Lowercase, underscores allowed — used as the RTL top-level name.

/

Part number, family, or keyword.

:8443

This key expired on 2026-06-30.

Shown to customers in the download portal.

Installation

npx shadcn@latest add input.json

Usage

Loading...

Props

Input

PropTypeDefaultDescription
invalidbooleanfalseError styling + aria-invalid
leadingReact.ReactNodeAdornment before the text (icon, prefix)
trailingReact.ReactNodeAdornment after the text (unit, kbd)

Plus all native <input> attributes. Textarea accepts native <textarea> attributes plus invalid.

Field

PropTypeDefaultDescription
labelstringField label
htmlForstringThe control's id; also derives the description id
requiredbooleanfalseShows the required marker
helpstringHelp text under the control
errorstringError message; replaces help and turns destructive