Input

GitHub

Labeled text input with optional leading icon and trailing button.

Installation

bash
pnpm dlx shadcn@latest add @cs/input

Usage

tsx
import { Mail, Search } from "lucide-react";
import { Input } from "@/components/cs/input";
tsx
<Input
  label="Search"
  name="search"
  icon={<Mail />}
  button={{ title: "Search", children: <Search /> }}
/>

API Reference

Input

Labeled text input with optional leading icon and trailing button.

Props

NameTypeDefaultDescription
buttonReact.ComponentPropsWithoutRef<"button">-Button displayed inside the input on the right.
errorstring | null-Validation error message for the field.
iconReactNode-Icon displayed inside the input on the left.
inputClassNamestring-Additional classes applied to the native input control.
labelReactNode-Field label and fallback placeholder.
orientationComponentProps<typeof Field>["orientation"]"vertical"Layout of the field label and input control.