Input

A text input component with label, hint, error, and icon support.

PREVIEW

We'll never share your email.

Username is already taken.

INSTALLATION

bash
# Required
npm install @kennbalino/kui

# Optional — only if you want to use CVA, cn(), or lucide icons directly
npm install class-variance-authority clsx tailwind-merge lucide-react

USAGE

tsx
import { Input } from "@kennbalino/kui";
import { Search } from "lucide-react";

// Default
<Input placeholder="Default input" />

// With label and hint
<Input
  label="Email"
  hint="We'll never share your email."
  placeholder="you@example.com"
/>

// With icon
<Input
  label="Search"
  placeholder="Search components..."
  leftIcon={<Search size={14} />}
/>

// Error state
<Input
  label="Username"
  placeholder="Enter username"
  error="Username is already taken."
/>

// Success state
<Input variant="success" label="Email" placeholder="you@example.com" />

// Disabled
<Input placeholder="Disabled input" disabled />

PROPS

PropTypeDefaultDescription
variantdefault | success | errordefaultControls the visual state of the input.
sizesm | md | lgmdControls the size of the input.
labelstringLabel text displayed above the input.
hintstringHelper text displayed below the input.
errorstringError message — overrides hint and sets error variant.
leftIconReactNodeIcon displayed on the left side of the input.
rightIconReactNodeIcon displayed on the right side of the input.
disabledbooleanfalseDisables the input and prevents interaction.