Skip to content

Input

Customizable text inputs supporting icons, validation errors, and disabled states.


Try Now


Usage

tsx
import { Input } from "@lablnet/ui";
import { Mail, Key } from "lucide-react";

export default function InputDemo() {
  return (
    <div className="space-y-4">
      {/* With leading icon */}
      <Input leftIcon={<Mail className="h-4 w-4" />} placeholder="Email Address" />

      {/* Password with key icon */}
      <Input type="password" leftIcon={<Key className="h-4 w-4" />} placeholder="Password" />

      {/* Error state border */}
      <Input error placeholder="Invalid input value" />
    </div>
  );
}

Customization

Props

PropTypeDefaultDescription
errorbooleanfalseFocuses the borders red for validation errors
leftIconReact.ReactNode-Displays icon inside left edge
rightIconReact.ReactNode-Displays icon inside right edge
wrapperClassNamestring-Additional class styling for wrapper wrapper div

CSS Variables

Input borders and focus rings correspond to standard tokens:

css
:root {
  --input: 220 13% 91%;  /* Input border HSL */
  --ring: 262.1 83.3% 57.8%; /* Focus outline ring HSL */
}