Input
Displays a form input field or a component that looks like an input field.
Preview
import { Input } from "@/components/ui/Input"
export function InputDemo() {
return (
<Input
aria-label="Email address"
type="email"
placeholder="name@example.com"
/>
)
}Installation
Make sure that namespace is set in your component.json file. Namespace docs: Learn more about namespaces
pnpm dlx shadcn@latest add @aura/inputManual
Copy and paste the class names utility into your utils/class-names.ts file.
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
Copy and paste the Input component into your components/ui/Input.tsx file.
/**
* @description Displays a form input field or a component that looks like an input field.
*/
import * as React from "react";
import { cn } from "@/utils/class-names";
function Input({ className, ...props }: React.ComponentProps<"input">) {
return <input data-slot="input" className={cn(className)} {...props} />;
}
export { Input };