Input

A flexible and accessible input field.

Installation

Add this component to your project using the npui CLI:

npx npui add input

Variants & Examples

Basic Input

A standard text input field.

1import { Input } from "@/components/ui/input";
2import { Label } from "@/components/ui/label";
3
4export function MyInput() {
5  return (
6    <div className="grid w-full max-w-sm items-center gap-1.5">
7      <Label htmlFor="email">Email</Label>
8      <Input type="email" id="email" placeholder="Email" />
9    </div>
10  );
11}

Props

These are the available props for the Input component:

PropTypeDescriptionDefault
typestringThe type of the input (e.g., 'text', 'email', 'password')."text"
placeholderstringPlaceholder text for the input field.-
idstringThe unique ID for the input element.-
disabledbooleanWhether the input is disabled.false