Input class creates a basic text input field for capturing single-line text from users. It extends InputBaseNode and provides character count validation and read-only mode support.
Inheritance
Constructor
Parameters
The unique identifier for the input field in the DOM.
The placeholder text displayed when the input is empty.
The initial value of the input field.
Maximum number of characters allowed in the input.
Whether the input should be displayed in a single line layout.
Material icon name to display alongside the input.
Custom error message to display when validation fails.
Whether the input is disabled.
Whether the input is read-only.
Synchronous validator(s) to apply to the input. Can be a single
ValidatorFn, an array of ValidatorFn, or null.Asynchronous validator(s) to apply to the input. Can be a single
AsyncValidatorFn, an array of AsyncValidatorFn, or null.Action(s) to execute when specific events occur on the input.
Properties
| Property | Type | Description |
|---|---|---|
id | string | The unique identifier for the input field |
placeholder | string | The placeholder text |
type | NodeType | The type of node (set to 'input') |
value | any | The current value of the input |
maxCharCount | number | Maximum character count |
minCharCount | number | Minimum character count |
readOnly | boolean | Whether the input is read-only |
singleLine | boolean | Single line layout flag |
icon | string | Material icon name |
errorMessage | string | Custom error message |
disabled | boolean | Disabled state |
validator | Validator | AbstractControlOptions | Synchronous validators |
asyncValidator | AsyncValidatorFn | Asynchronous validator |
action | Action | Action[] | Associated actions |
hint | string | Hint text displayed below the input |
autoFocus | boolean | Whether to auto-focus the input |
Methods
editable()
Makes the input field editable by settingreadOnly to false.
readonly()
Makes the input field read-only by settingreadOnly to true.
apply()
Inherited fromObjectBase. Applies additional properties to the node instance.
getNativeElement()
Returns the native DOM element for this input.Usage Examples
Basic Input
Input with Validation
Input with Character Limit
Read-Only Input
Input with Actions
Dynamic Read-Only Toggle
Related Node Types
- InputPassword - Input field for password entry
- InputNumber - Input field for numeric values
- TextArea - Multi-line text input
- InputFile - File upload input
