Input

Text input with label, helper text, and error state. Fully accessible with auto-generated IDs.

Basic

import { Input } from '@canarist/ui'

<Input label="Email" placeholder="you@example.com" />

With helper text

Must be 3–20 characters.

<Input
  label="Username"
  placeholder="johndoe"
  helperText="Must be 3–20 characters."
/>

Error state

Please enter a valid email address.

<Input
  label="Email"
  placeholder="you@example.com"
  error="Please enter a valid email address."
/>

Disabled

<Input label="Read-only field" value="Cannot edit this" disabled readOnly />

Reference

PropTypeDefaultDescription
labelstringLabel rendered above the input.
errorstringError message displayed below the input. Applies error styles.
helperTextstringHelper text shown below when no error is present.
idstringExplicit ID. Auto-generated if omitted.
...InputHTMLAttributesReact.InputHTMLAttributes<HTMLInputElement>All native input attributes are forwarded.