Library/Input

Input

Form primitive with label support, error states, and focus animations.

Simple Build
Interactive Preview
Initialising Operative...

Architecture

Component Architecture
Input/

Prop Usage

PropTypeDefaultDescription
label
stringFloating label shown above the input.
error
stringError message shown below the input in red.
type
string"text"HTML input type (text, email, password, etc).
placeholder
stringPlaceholder text shown inside the input.
disabled
booleanfalseDisables the input.
required
booleanfalseMarks the input as required.
className
stringAdditional Tailwind classes.
onChange
(e: React.ChangeEvent<HTMLInputElement>) => voidChange handler.

Usage

import { Input } from '@/ui'; // Basic <Input label="Email" type="email" placeholder="you@example.com" /> // With error <Input label="Password" type="password" error="Password must be at least 8 characters" /> // Controlled const [value, setValue] = useState(''); <Input label="Username" value={value} onChange={e => setValue(e.target.value)} />