Overview
Get Started
Components
- Accordion
- Alert Dialog
- Alert
- Autocomplete
- Avatar
- Badge
- Button Group
- Button
- Calendar
- Checkbox Group
- Checkbox
- Collapsible
- Combobox
- Command
- Dialog
- Field
- Form
- Input Group
- Input
- Kbd
- Label
- Menu
- Meter
- Navigation Menu
- Number Field
- Number InputNew
- OTP Field
- Pagination
- Popover
- Radio Group
- Scroll Area
- Select
- Sheet
- Sidebar
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Tooltip
Input
A native input element that automatically works with Field for labeling and validation.
import { Input } from "@/components/ui/input";
export function InputDemo() {
return <Input type="email" placeholder="Email" className="max-w-sm" />;
}Installation
pnpm dlx @zbmui/cli@latest add input
Usage
import { Input } from "@/components/ui/input";<Input />Examples
Sizes
import { Input } from "@/components/ui/input";
export function InputDemo() {
return (
<div className="flex flex-col gap-4">
<Input placeholder="Name" size="xs" />
<Input placeholder="Name" size="sm" />
<Input placeholder="Name" size="default" />
<Input placeholder="Name" size="lg" />
<Input placeholder="Name" size="xl" />
</div>
);
}File Input
import { Input } from "@/components/ui/input";
export function InputDemo() {
return (
<div className="flex flex-col gap-2">
<label htmlFor="picture">Picture</label>
<Input id="picture" type="file" />
</div>
);
}Disabled
import { Input } from "@/components/ui/input";
export function InputDemo() {
return <Input placeholder="Enter your name" disabled className="max-w-sm" />;
}API Reference
Input Props
Component type props
Prop
Type
Default
Expand prop details
The size of the input component.
Type
'xs' | 'sm' | 'default' | 'lg' | 'xl'Default
'default'