Input

A single-line text field with optional label and helper text. Supports default, error, and success states with matching focus rings and helper text colors — all driven by AvilaDS tokens.

Default

Must be 3–20 characters.

States

Invalid email address.
Looks good!

Sizes

import { Input } from '@/components/Input';

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

// With helper text
<Input
  label="Username"
  placeholder="your-username"
  helperText="Must be 3–20 characters."
/>

// Error state
<Input
  variant="error"
  label="Email"
  placeholder="you@example.com"
  helperText="Invalid email address."
/>

// Success state
<Input
  variant="success"
  label="Email"
  placeholder="you@example.com"
  helperText="Looks good!"
/>

// Sizes
<Input inputSize="sm" placeholder="Small" />
<Input inputSize="md" placeholder="Medium" />
<Input inputSize="lg" placeholder="Large" />

// Full width
<Input label="Full width" placeholder="Stretches to container" fullWidth />

// Disabled
<Input label="Read only" placeholder="Not editable" disabled />
PropTypeDefaultDescription
variant'default' | 'error' | 'success''default'Visual state of the input. error shows a hot-pink border; success shows a teal border. Both affect the focus ring and helper text color.
inputSize'sm' | 'md' | 'lg''md'Height and padding. sm = 36px, md = 44px, lg = 52px. Named inputSize to avoid collision with the native HTML size attribute.
labelstringLabel text rendered above the input. Automatically associated via htmlFor/id.
helperTextstringHelper or validation message rendered below the input. Color follows variant.
fullWidthbooleanfalseStretches the input to fill its container width.
disabledbooleanfalseDisables the input, reduces opacity to 0.4, and sets aria-disabled.
placeholderstringPlaceholder text shown when the input is empty.
idstringHTML id. Auto-generated from label if omitted.
classNamestringAdditional CSS class names merged into the input element.