Input#

Text input component for single-line text entry with model binding support.

Import#

TSX
import { Input, Col } from '@sigx/daisyui';

Basic Usage#

Use model for two-way binding:

TSX
Loading preview...

Input Types#

TSX
Loading preview...

Sizes#

TSX
Loading preview...

Colors#

TSX
Loading preview...

Variants#

TSX
Loading preview...

With FormField#

Wrap inputs with FormField for labels, helper text, and error messages:

TSX
Loading preview...

Number Input#

For number inputs, the model value is automatically converted to a number:

TSX
Loading preview...

Disabled and ReadOnly#

TSX
Loading preview...

Max Length#

TSX
Loading preview...

Login Form Example#

TSX
Loading preview...

Autocomplete Control#

Use autoComplete to control browser autofill behavior:

TSX
Loading preview...

Common autoComplete values: 'off', 'on', 'email', 'username', 'current-password', 'new-password', 'name', 'tel', 'address-line1'.

Props#

PropTypeDefaultDescription
model() => signal.property-Model binding for two-way sync
namestring-Input name for form submission
type'text' | 'email' | 'password' | 'number' | 'search' | 'url' | 'tel''text'Input type
size'xs' | 'sm' | 'md' | 'lg''md'Input size
variant'bordered' | 'ghost'-Visual variant
color'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'-Border color
placeholderstring-Placeholder text
disabledbooleanfalseDisable the input
readOnlybooleanfalseRead-only state
maxLengthnumber-Maximum character length
autoCompletestring-Browser autocomplete hint ('off', 'new-password', 'email', etc.)
classstring-Additional CSS classes

Events#

EventTypeDescription
onInput(e: InputEvent) => voidFired on each keystroke (raw DOM event)
onChange(e: Event) => voidFired when focus leaves the input
onFocus(e: FocusEvent) => voidFired when input gains focus
onBlur(e: FocusEvent) => voidFired when input loses focus