Input
FormText input field with consistent border and focus ring styling.
Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.
"use client";
import { Input } from "@dashboardpack/core/components/ui/input";
import { Label } from "@dashboardpack/core/components/ui/label";
export default function InputExample() {
return (
<div className="w-full max-w-sm space-y-5">
<div className="space-y-2">
<Label htmlFor="input-email">Email address</Label>
<Input id="input-email" type="email" placeholder="you@company.com" />
</div>
<div className="space-y-2">
<Label htmlFor="input-invalid">Workspace name</Label>
<Input
id="input-invalid"
defaultValue="a"
aria-invalid
aria-describedby="input-error"
/>
<p id="input-error" className="text-sm text-destructive">
Use at least two characters.
</p>
</div>
<div className="space-y-2">
<Label htmlFor="input-disabled">Managed by your organization</Label>
<Input id="input-disabled" disabled value="Apex Studio" />
</div>
</div>
);
}Usage
Pair every input with a label. Use native type, required, autoComplete, and inputMode attributes. Connect validation text with aria-describedby.
import { Input } from "@dashboardpack/core/components/ui/input";Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.
API reference
Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.
| Prop | Type / Default | Description |
|---|---|---|
| type | HTML input typeDefault: text (browser) | Native input behavior. |
| value / defaultValue | string | numberDefault: — | Use value with onChange for controlled input. |
| onChange | ChangeEventHandler<HTMLInputElement>Default: — | Handle edits to the value. |
| disabled | booleanDefault: false | Make the field unavailable. |
| aria-invalid | booleanDefault: — | Expose validation failure. |