H
Harukit UIDocumentation
Components

Input

A flexible input component with built-in styling and accessibility features.

Installation

bunx --bun harukit@latest add input
npx harukit@latest add input
pnpm dlx harukit@latest add input
yarn harukit@latest add input

Example

import { Input } from "@/components/ui/input";

export function InputDemo() {
  return (
    <div className="grid w-full items-center gap-1.5">
      <label htmlFor="email">Email</label>
      <Input type="email" id="email" placeholder="Enter your email" />
    </div>
  );
}

Usage

Import

import { Input } from "@/components/ui/input";

Code

<Input />

API Reference

PropTypeDefaultDescription
typestring"text"The type of input.
placeholderstring-Placeholder text for the input.
disabledbooleanfalseWhen true, prevents the user from interacting with the input.
readOnlybooleanfalseWhen true, the input is read-only.
requiredbooleanfalseWhen true, the input is required.
valuestring-The value of the input.
onChange(event: ChangeEvent<HTMLInputElement>) => void-Event handler called when the value changes.
onFocus(event: FocusEvent<HTMLInputElement>) => void-Event handler called when the input receives focus.
onBlur(event: FocusEvent<HTMLInputElement>) => void-Event handler called when the input loses focus.