Overview
The Input component provides a feature-rich text input field with support for various input types, validation, prefix/suffix icons, error states, and multiple visual variants.Import
Basic Usage
Properties
Inputs
Two-way bindable input value using signal-based model()
Placeholder text displayed when input is empty
HTML input typeOptions:
'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search'Size of the input fieldOptions:
'small' | 'normal' | 'large'Visual style variantOptions:
'filled' | 'outlined' | 'underlined'When true, input is disabled and cannot be edited
When true, input is read-only
When true, field is required and validated on blur
When true, displays loading indicator in suffix position
Error message to display below the input
When true, displays success state styling
Label text displayed above the input
Custom ARIA label for accessibility. Falls back to label or placeholder.
Helper text displayed below the input
Lucide icon name to display at the start of the input
Lucide icon name to display at the end of the input
Custom width (CSS value)
Maximum number of characters allowed
Outputs
Emitted when the input receives focus
Emitted when the input loses focus. Triggers validation.
Emitted when prefix or suffix icon is clicked
Examples
Input Types
Visual Variants
Sizes
With Icons
Password with Toggle
With Validation
Success State
Loading State
Character Limit
Icon Click Handler
Disabled and Readonly
Validation
The input component includes built-in validation:Required Field Validation
Whenrequired is true, the component validates on blur:
Email Validation
Whentype="email", validates email format on blur:
Custom Validation
Use theerror input for custom validation messages:
Accessibility
The Input component includes comprehensive accessibility features:- ARIA Labels: Auto-generated from label, ariaLabel, or placeholder
- ARIA Described By: Links to error/help text
- Error Announcements: Screen readers announce validation errors
- Focus Indicators: Clear visual focus states
- Input Modes: Appropriate inputmode for mobile keyboards
Password Visibility Toggle
- ARIA Label: “Show password” / “Hide password”
- Keyboard Accessible: Fully accessible via keyboard
- Icon Updates: Visual indication of current state
Component Details
- Selector:
magary-input - Source:
/home/daytona/workspace/source/projects/ng-magary/src/lib/Form/input/input.ts - Standalone: Yes (with CommonModule, FormsModule, LucideAngularModule)
- Change Detection: OnPush
