Search documentation

Search components and pages

Input

A text input for forms and user data entry.

01

Installation

Add the input component with the shadcn CLI.

bash
npx shadcn@latest add https://swiss.ui.unsanity.ai/r/input.json
02

Usage

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

<Input placeholder="Email" />
03

Examples

Disabled

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

<Input disabled placeholder="Disabled" className="w-64" />

With label

import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"

<div className="grid w-64 gap-1.5">
  <Label htmlFor="email">Email</Label>
  <Input id="email" type="email" placeholder="you@example.com" />
</div>