Component guideEditable source

Input

A single-line form control with native input behavior and theme-aware styling.

Original component docs
On this page9 sectionsBack to top

Use Input for short text, email, password, or file entry. It wraps Base UI Input and preserves ordinary input props. Use Textarea for multi-line text and Input Group for attached units or actions.

Live preview
Loading preview...

#Installation

Complete the base setup. For manual installation:

npx shadcn@latest add https://neobrutal-ui.andongmin.com/r/input.json

#Usage

import { Input } from "@/components/ui/input";

export default function EmailField() {
  return (
    <div className="grid w-full max-w-sm gap-2">
      <label htmlFor="email">Email address</label>
      <Input
        id="email"
        name="email"
        type="email"
        autoComplete="email"
        required
        aria-describedby="email-help"
      />
      <p id="email-help" className="text-sm">
        Used only for workspace invitations.
      </p>
    </div>
  );
}

#API reference

PropPurposeDefault
typeNative type such as text, email, password, filetext
value / onChangeControlled value and native eventUncontrolled
defaultValueInitial uncontrolled value—
id / nameLabel association and form key—
disabled / required / readOnlyNative constraintsfalse
aria-invalid / aria-describedbyInvalid state and supporting textUnset

#Accessibility

Provide a visible label or justified accessible name. A placeholder is not a label. Match autocomplete and input mode to the task. Do not control the value of a file input. Associate validation feedback with the field and validate submitted data on the server.

#Examples

The File and With label examples additionally use Label. Install it before copying their Code:

npx shadcn@latest add https://neobrutal-ui.andongmin.com/r/label.json

#File

Loading preview...

#Disabled

Loading preview...

#With label

Loading preview...

#With button

Loading preview...