A styled text input field with support for all native input types, validation states, and file uploads.
A single-line text input built on Base UI's Input primitive. It provides consistent styling for text, email, password, number, and file inputs with focus ring, placeholder, disabled, and invalid states.
import { Input } from "@/components/ui/input"
export default function InputDemo() {
return <Input type="email" placeholder="Email" />
}
import { Input } from "@/components/ui/input"<Input type="text" placeholder="Enter text..." /><Input placeholder="Email address" type="email" /><Input placeholder="Disabled input" disabled />The file input renders an inline file button with consistent styling.
<Input type="file" />Set aria-invalid="true" to display destructive styling with a red border and ring.
<Input placeholder="Email" aria-invalid="true" />A styled <input> element. Accepts all standard HTML input attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
type | string | — | The HTML input type (text, email, password, number, file, etc.). |
placeholder | string | — | Placeholder text displayed when the input is empty. |
disabled | boolean | false | Disables the input and applies reduced opacity. |
aria-invalid | boolean | — | When true, applies destructive border and ring styles. |
className | string | — |