Input

This is a simple input component.

Installation

1. Dependencies

npm install clsx tailwind-merge

2. Paste inside @/lib/utils.ts

import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: Parameters<typeof clsx>) {
  return twMerge(clsx(...inputs));
}

3. Copy Input Code

Loading...

Copy Input Code

Input Props

NameTypeRequiredDefaultDescription
placeholderstringNo"Enter text here..."Placeholder text for the input field.
errorbooleanNofalseIndicates if the input is in an error state.
variant"sm" | "md" | "lg"No"md"Variant of the input field.
type"text" | "password" | "email" | "number"No"text"Type of the input field.
classNamestringNoundefinedAdditional classnames for custom styling of the container.