vert-ui
Browse docs
All components

Input

Single-line text field with validation state, focus ring and file/placeholder support.

Install

Install the component

Add the source straight into your project with the shadcn CLI — no package dependency to track.

npx shadcn@latest add https://vert-ui.dev/r/input.json

Preview

Live preview

Found in workspace settings.

Usage

Examples

Invalid state

Enter a valid email address.

<Input invalid aria-label="Email" placeholder="you@example.com" />
<p className="text-xs font-medium text-destructive">
  Enter a valid email address.
</p>

With label and hint

Visible to everyone in the org.

<div className="space-y-2">
  <Label htmlFor="workspace">Workspace name</Label>
  <Input id="workspace" placeholder="Acme Inc" />
  <p className="text-xs text-muted-foreground">Visible to everyone in the org.</p>
</div>

Sizes and disabled

<Input size="sm" placeholder="Small" aria-label="Small" />
<Input size="md" placeholder="Medium" aria-label="Medium" />
<Input size="lg" placeholder="Large" aria-label="Large" />
<Input disabled defaultValue="Locked field" aria-label="Disabled" />

Reference

Props

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"Control height and text scale. Use lg on touch-first or prominent fields.
invalidboolean—Marks the field invalid: sets aria-invalid, data-invalid and the destructive border.
typestring"text"Native input type — email, password, search, number…
placeholderstring—Hint shown while empty. Not a substitute for a label.
disabledboolean—Native disabled state — dimmed, skipped by tab and pointer.
requiredboolean—Native required flag: browser validation plus SR announcement.
…native input attrsInputHTMLAttributes<HTMLInputElement>—value, onChange, autoComplete, minLength, inputMode, …

Accessibility

Accessibility notes

  • Every input needs a programmatic name: pair it with Label htmlFor (or use Field, which wires it for you).
  • invalid flips aria-invalid — screen readers announce the state on focus; keep an inline error text linked by aria-describedby (Field does this automatically).
  • Placeholders vanish on typing and often fail contrast — keep them for examples, labels for real forms.
  • Native required works with browser validation; a visual asterisk alone is not enough.