Input
Displays a form input field. Supports various types, states, and integrates with Angular forms.
Preview
A preview of the Input component with interactive controls.
Interactive
Installation
Add the Input component to your project.
ng g @ng-cn/core:c inputUsage
Import and use the Input component in your Angular application.
<Input type="text" placeholder="Enter text..." />Examples
Explore different variations and use cases for the Input component.
Basic
A simple text input with placeholder.
Interactive
With Label
Input with an associated label for accessibility.
Interactive
Input Types
Different input types for various data formats.
Interactive
Disabled State
Input in disabled state.
Interactive
With Error State
Input with error styling for validation feedback.
Interactive
With Icon
Input with leading or trailing icons.
Interactive
File Input
Styled file input for uploads.
Interactive
With Form Integration
Input integrated with Angular Reactive Forms.
Interactive
Password with Visibility Toggle
Password input with show/hide toggle.
Interactive
API Reference
Props | Prop | Type | Default | Description |
|---|---|---|---|
type | string | 'text' | The HTML input type. |
placeholder | string | — | Placeholder text. |
disabled | boolean | false | Whether the input is disabled. |
readonly | boolean | false | Whether the input is read-only. |
class | string | — | Additional CSS classes. |
id | string | — | The input id for label association. |
name | string | — | The input name attribute. |
value | string | — | The input value. |
required | boolean | false | Whether the input is required. |