Installation
Theme
Mode

Forms & input

Input

The text field people type into all day — task names, search, emails, amounts, notes. One control handles labels, helper and error text, leading icons, prefixes, counters, and a multi-line mode.

$npx shadcn@latest add @orbit/input

Playground

Keep it short and action-oriented.
TypeSize

Anatomy

A field is a vertical stack: an optional label row, the input itself with adornment slots, and a footer for guidance, errors, or a counter.

We'll send the invite here.
  1. 1LabelA persistent field name, with an optional “Optional” tag on the right when a field isn’t required.
  2. 2Leading slotA muted icon — or inline prefix text — that frames what to type.
  3. 3Value & placeholderThe text the person enters; placeholder shows an example in muted gray until they do.
  4. 4FooterHelper text, the in-place error message, and an optional character counter.

Field types

One type prop adapts the keyboard, affordances, and validation hints.

Text — type="text" · the default single-line field
Search — type="search" · leading icon plus a shortcut hint while empty
/
Email — type="email" · email keyboard and inputmode
Password — type="password" · trailing reveal toggle
Number — type="number" · tabular numerals, decimal inputmode, affixes
$USD
Textarea — type="textarea" · multi-line with an optional counter
48/280

Icons, affixes & actions

Slots on either side of the value: a leading icon, inline prefix/suffix text, a keyboard hint, and trailing actions like clear or reveal.

Leading icon — frames the field’s purpose at a glance · Prefix — inline, muted text before the value
https://
Suffix — units or domains after the value · Keyboard hint — shows a shortcut until the field is used
hrs
⌘K
Clearable — a trailing × resets the value · Counter — tracks length against a max
20/32

Sizes

md 34px (default) · sm 30px. Matched to Select and Button so fields line up in any form row.

States

Borders and rings communicate status; helper text becomes the error message in place.

Default · Focus (forced for the demo)
Helper text sits below the field.
A themed ring marks the active field.
Filled · valid — trailing success check · Error — danger border, in-place message
Looks good.
Enter a valid email address.
Read-only — muted fill, still focusable · Disabled — flat and inert
Generated automatically.
Not editable right now.

Props

PropTypeDefaultDescription
type"text" | "search" | "password" | "email" | "url" | "number" | "textarea""text"Field type. “textarea” switches to the multi-line field.
size"sm" | "md""md"Control height: 30 / 34px.
labelstringPersistent field name above the wrapper, bound with htmlFor.
placeholderstringShort example value in muted gray.
value / defaultValuestringControlled value with onChange, or an uncontrolled initial value.
helperstringGuidance below the field.
errorTextstringMessage that replaces helper while error is set.
iconLeftReactNodeMuted leading icon (15px md / 14px sm).
prefix / suffixstringInline muted text before / after the value ($, USD, https://, hrs).
kbdstringKeyboard-hint chip shown while the field is empty.
clearablebooleanfalseTrailing × that resets the value; Esc does the same.
counterbooleanfalseCharacter counter — requires maxLength; warns above 90%.
maxLengthnumberNative maxLength, also drives the counter.
rowsnumber3Visible rows for type=“textarea”.
optionalbooleanfalseMuted “Optional” tag on the label row.
errorbooleanfalseDanger border and message; sets aria-invalid.
validbooleanfalseTrailing success check (single-line, non-password).
disabled / readOnlybooleanfalseNative disabled / read-only states.
forceState"none" | "hover" | "focus" | "error""none"Demo aid — pins a visual state.
widthstring"280px"Root width; use “100%” to fill or “auto”.
…restInputHTMLAttributesEverything else is forwarded to the native <input> / <textarea>, including ref.

Usage

Do

Always pair a field with a label

Persistent labels beat placeholder-only fields, which vanish the moment typing starts.

Don’t

Put instructions in the placeholder

Use helper text for guidance; the placeholder is just a short example value.

Do

Show errors in place, on blur

Swap helper text for a specific message and red border next to the field.

Enter a valid email address.
Don’t

Validate on every keystroke

Flagging an email as invalid mid-typing is noisy — wait until the field loses focus.

Keyboard & accessibility

Native <input> / <textarea> semantics. The label is bound with htmlFor, aria-invalid is set on error, and helper or error text is linked via aria-describedby.

Tab into the field — Esc clears it while it holds a value
⌘K
TabMove between fields
EscClear (clearable fields)
⌘K /Common search hints
aria-invalidSet on error
aria-describedbyLinks helper / error
labelBound to the field via htmlFor