Components
Input
Single-line text input with error state and file input support.
Category: Form / Standalone
Import
import { Input } from "@hareru/ui"Exports
| Name | Type | Description |
|---|---|---|
Input | Component | Main input component |
InputProps | Type | Props interface |
Types
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
error?: boolean
}Key Props
| Prop | Type | Default | Description |
|---|---|---|---|
error | boolean | false | Applies error styling (hui-input--error) |
type | string | — | When "file", automatically adds hui-input--file class |
Accessibility
- Keyboard:
- Standard text input keyboard interactions
Usage
import { Input } from "@hareru/ui"
// Basic usage
<Input placeholder="Enter text" />
// Error state
<Input error placeholder="Error state" />
// File input
<Input type="file" />
// Controlled input
<Input
value={value}
onChange={(e) => setValue(e.target.value)}
placeholder="Controlled"
/>Notes
- All native
HTMLInputElementattributes are forwarded. - Setting
type="file"automatically applies thehui-input--fileBEM modifier — no need to add it manually. - The
errorprop only applies visual styling. Pair withFormFieldfor full accessible error handling.