Input
Text input component for single-line text entry with model binding support.
Import
import { Input, Col } from '@sigx/daisyui';
Basic Usage
Use model for two-way binding:
Loading preview...
Input Types
Loading preview...
Sizes
Loading preview...
Colors
Loading preview...
Variants
Loading preview...
With FormField
Wrap inputs with FormField for labels, helper text, and error messages:
Loading preview...
Number Input
For number inputs, the model value is automatically converted to a number:
Loading preview...
Disabled and ReadOnly
Loading preview...
Max Length
Loading preview...
Login Form Example
Loading preview...
Autocomplete Control
Use autoComplete to control browser autofill behavior:
Loading preview...
Common autoComplete values: 'off', 'on', 'email', 'username', 'current-password', 'new-password', 'name', 'tel', 'address-line1'.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
model | () => signal.property | - | Model binding for two-way sync |
name | string | - | 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 |
placeholder | string | - | Placeholder text |
disabled | boolean | false | Disable the input |
readOnly | boolean | false | Read-only state |
maxLength | number | - | Maximum character length |
autoComplete | string | - | Browser autocomplete hint ('off', 'new-password', 'email', etc.) |
class | string | - | Additional CSS classes |
Events
| Event | Type | Description |
|---|---|---|
onInput | (e: InputEvent) => void | Fired on each keystroke (raw DOM event) |
onChange | (e: Event) => void | Fired when focus leaves the input |
onFocus | (e: FocusEvent) => void | Fired when input gains focus |
onBlur | (e: FocusEvent) => void | Fired when input loses focus |