Harbour UI

Input

Text input with built-in label association using useId(), validation states, and helper text. Accessible by default — aria-invalid and aria-describedby are set automatically.

Preview

We'll never share your email.

Usage

jsx
import { Input } from '@/components/ui'

// Default
<Input class="text-sky-300">label="Email" class="text-sky-300">placeholder="you@example.com" />

// With validation
<Input
  class="text-sky-300">label="Username"
  class="text-sky-300">error="Username is already taken."
  class="text-sky-300">defaultValue="isadev"
/>

// Success state
<Input class="text-sky-300">label="Username" success class="text-sky-300">defaultValue="isaramdev" />

Props

PropTypeDefaultDescription
labelstringVisible label, correctly associated via useId().
helperTextstringHint text displayed below the field.
errorstringError message. Sets aria-invalid and red border.
successbooleanfalseGreen border and checkmark icon.
size'sm' | 'md' | 'lg''md'Controls field size.
requiredbooleanfalseAdds visual asterisk and required attribute.
disabledbooleanfalseDisables the field.