Copy to clipboard
<Input type="email" placeholder="Email" />
<Input type="email" placeholder="Email" /><Input type="email" placeholder="Email" />
Installation
Copy to clipboard
npx bearnie add input
npx bearnie add inputnpx bearnie add input
bunx bearnie add input
bunx bearnie add inputbunx bearnie add input
pnpm dlx bearnie add input
pnpm dlx bearnie add inputpnpm dlx bearnie add input
yarn dlx bearnie add input
yarn dlx bearnie add inputyarn dlx bearnie add input
Usage
import { Input } from "@/components/bearnie/input"<Input type="email" placeholder="Email" />Examples
With label
Copy to clipboard
<div class="grid gap-2 w-full max-w-sm">
<Label for="email">Email</Label>
<Input type="email" id="email" placeholder="m@example.com" />
</div>
<div class="grid gap-2 w-full max-w-sm">
<Label for="email">Email</Label>
<Input type="email" id="email" placeholder="m@example.com" />
</div><div class="grid gap-2 w-full max-w-sm">
<Label for="email">Email</Label>
<Input type="email" id="email" placeholder="m@example.com" />
</div>
Password
Copy to clipboard
<Input type="password" placeholder="Password" />
<Input type="password" placeholder="Password" /><Input type="password" placeholder="Password" />
Disabled
Copy to clipboard
<Input disabled placeholder="Disabled" />
<Input disabled placeholder="Disabled" /><Input disabled placeholder="Disabled" />
With left icon
Copy to clipboard
<div class="relative w-full max-w-sm">
<HugeIcon icon={Mail01Icon} class="absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" />
<Input type="email" placeholder="Email" class="pl-10" />
</div>
<div class="relative w-full max-w-sm">
<HugeIcon icon={Mail01Icon} class="absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" />
<Input type="email" placeholder="Email" class="pl-10" />
</div><div class="relative w-full max-w-sm">
<HugeIcon icon={Mail01Icon} class="absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" />
<Input type="email" placeholder="Email" class="pl-10" />
</div>
With right icon
Copy to clipboard
<div class="relative w-full max-w-sm">
<Input type="search" placeholder="Search..." class="pr-10" />
<HugeIcon icon={Search01Icon} class="absolute right-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" />
</div>
<div class="relative w-full max-w-sm">
<Input type="search" placeholder="Search..." class="pr-10" />
<HugeIcon icon={Search01Icon} class="absolute right-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" />
</div><div class="relative w-full max-w-sm">
<Input type="search" placeholder="Search..." class="pr-10" />
<HugeIcon icon={Search01Icon} class="absolute right-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" />
</div>
With button
Copy to clipboard
<div class="flex gap-2 w-full max-w-sm">
<Input type="email" placeholder="Email" />
<Button>Subscribe</Button>
</div>
<div class="flex gap-2 w-full max-w-sm">
<Input type="email" placeholder="Email" />
<Button>Subscribe</Button>
</div><div class="flex gap-2 w-full max-w-sm">
<Input type="email" placeholder="Email" />
<Button>Subscribe</Button>
</div>
File
Copy to clipboard
<div class="grid gap-2 w-full max-w-sm">
<Label for="file">Upload file</Label>
<Input id="file" type="file" />
</div>
<div class="grid gap-2 w-full max-w-sm">
<Label for="file">Upload file</Label>
<Input id="file" type="file" />
</div><div class="grid gap-2 w-full max-w-sm">
<Label for="file">Upload file</Label>
<Input id="file" type="file" />
</div>
Anatomy
Input- A single form input element
Props
Input
| Prop | Type | Default | Description |
|---|---|---|---|
| type | text | email | password | search | tel | url | number | text | Input type |
| placeholder | string | - | Placeholder text |
| disabled | boolean | false | Disables the input |
| required | boolean | false | Makes the field required |
| name | string | - | Form field name |
| id | string | - | Element ID |
| value | string | - | Input value |
| class | string | - | Additional CSS classes |