Shadcn UI Components
Input
Input components for collecting user data. Includes text input, email, password, file upload, and textarea variations.
Input Examples
Basic Input
Input with Label
Input with Helper Text
Enter your email address.
Input with Button
Disabled Input
File Input
Textarea
Textarea with Helper Text
Your message will be copied to the support team.
Installation
# The components are already installed at:
# src/components/ui/shadcn/input.tsx
# src/components/ui/shadcn/textarea.tsx
# src/components/ui/shadcn/label.tsx
Usage
import { Input } from '@/components/ui/shadcn/input'
import { Label } from '@/components/ui/shadcn/label'
import { Textarea } from '@/components/ui/shadcn/textarea'
export function InputDemo() {
return (
<div className="grid gap-4">
<div className="grid gap-2">
<Label htmlFor="email">Email</Label>
<Input type="email" id="email" placeholder="Email" />
</div>
<div className="grid gap-2">
<Label htmlFor="message">Message</Label>
<Textarea id="message" placeholder="Type your message..." />
</div>
</div>
)
}
Props
Input
| Prop | Type | Description |
|---|---|---|
| type | string | The input type (text, email, password, file, etc.) |
| disabled | boolean | Disables the input |
| placeholder | string | Placeholder text |
Textarea
| Prop | Type | Description |
|---|---|---|
| rows | number | Number of visible text lines |
| disabled | boolean | Disables the textarea |
| placeholder | string | Placeholder text |