Components
Displays a form input field or a component that looks like an input field.
Playground
type. Text renders at 16px on mobile — so iOS never zooms the field on focus — and drops to 14px from the md breakpoint up.import { Input } from "@workspace/ui/components/input"
<Input type="email" placeholder="Email" /><div className="grid w-full max-w-sm gap-3"> <Label htmlFor="email">Email</Label> <Input id="email" type="email" placeholder="Email" /> </div>
type="file" the browse control is styled through the file: variants — transparent background, small medium-weight text in the foreground color.<div className="grid w-full max-w-sm gap-3"> <Label htmlFor="picture">Picture</Label> <Input id="picture" type="file" /> </div>
<Input type="email" placeholder="Email" disabled />
aria-invalid when validation fails — the border and ring switch to the destructive color, and assistive technology announces the state. Inside a Field, FieldError wires this up automatically.<Input type="email" placeholder="Email" aria-invalid />
<div className="flex w-full max-w-sm items-center gap-2">
<Input type="email" placeholder="Email" />
<Button type="submit" variant="outline">
Subscribe
</Button>
</div><Field>
<FieldLabel htmlFor="username">Username</FieldLabel>
<Input id="username" placeholder="Enter your username" />
<FieldDescription>
Choose a unique username for your account.
</FieldDescription>
</Field><div dir="rtl" className="grid w-full max-w-sm gap-3"> <Label htmlFor="email-rtl">البريد الإلكتروني</Label> <Input id="email-rtl" type="email" placeholder="البريد الإلكتروني" /> </div>
| Prop | Type | Default |
|---|---|---|
| type | HTMLInputTypeAttribute | "text" |
Tokens used
10 design tokens consumed by the Input component.
--input
Input
--ring
Ring
--destructive
Destructive
--muted-foreground
Muted Foreground
--foreground
Foreground
--text-base
Text Base (16px)
--text-sm
Text Small (14px)
--font-weight-medium
Font weight Medium (500)
--radius-md
Radius 0.8× (8px)
--spacing
Spacing unit (4px)