Binhlaig UI Component

Input

Input fields allow users to enter text, email, passwords, numbers, dates and files.

Installation

Add the Input component using the Binhlaig UI CLI.

Terminal
npx binhlaig-ui@latest add input

Import

Import the Input component from your UI directory.

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

Usage

Use Input for simple text entry.

Input Types

Input supports all standard HTML input types.

With Label

Use a label to clearly identify the requested value.

With Description

Supporting text can explain the expected input value.

This will be your public display name.

With Icons

Add an icon to provide visual context.

Password Input

Allow users to show or hide their password.

Disabled State

Disabled inputs cannot be edited or focused.

Error State

Use aria-invalid and error styles for invalid values.

Enter a valid email address.

File Input

Use the file input type to upload files.

Form Example

Combine inputs and buttons to create a complete form.

API Reference

The Input component accepts standard React input properties.

PropTypeDefaultDescription
typeReact.HTMLInputTypeAttribute"text"Controls the type of input value.
placeholderstring—Displays temporary hint text.
valuestring | number—Controls the current input value.
defaultValuestring | number—Sets the initial uncontrolled value.
disabledbooleanfalsePrevents interaction with the input.
readOnlybooleanfalsePrevents editing while allowing focus.
requiredbooleanfalseMarks the input as required.
aria-invalidbooleanfalseMarks the current value as invalid.
classNamestring—Adds custom Tailwind CSS classes.
onChangeReact.ChangeEventHandler<HTMLInputElement>—Runs whenever the input value changes.