Input

A flexible text input component that supports multiple HTML input types, three size variants, a multiline mode (rendered as a <textarea>), and inline error message display. Built with class-variance-authority for consistent styling.

Import

import { Input } from '@wavebooking/aqua-fusion';

Preview

Loading preview...

Usage

<Input placeholder="Enter your name" />

<Input type="email" inputSize="lg" placeholder="Email address" />

<Input
  type="password"
  error="Password must be at least 8 characters"
/>

<Input multiline placeholder="Write a message..." />

Props

PropTypeDefaultDescription
type'text' | 'number' | 'email' | 'password' | 'date' | 'time' | 'file' | 'tel' | 'datetime-local''text'HTML input type. Ignored when multiline is enabled.
inputSize'default' | 'sm' | 'lg''default'Size variant controlling the height of the input.
multilineboolean | 'sm' | 'lg'falseRenders a textarea instead of an input. Pass a string size to control the minimum height.
errorboolean | stringfalseError state. When a string is provided, it is displayed as an inline error message.
onChange(e: ChangeEvent) => void-Change event handler for the input or textarea.
placeholderstring-Placeholder text shown when the input is empty.
disabledbooleanfalseWhether the input is disabled.
idstring-HTML id attribute. Used to associate the error message via aria-describedby.
classNamestring-Additional CSS classes to apply.

The component also accepts all standard HTML <input> and <textarea> attributes (except size, which is replaced by inputSize).