packages/components/eui-textarea/eui-textarea.component.ts
Multiline text input field for entering longer text content.
euiTextArea provides an enhanced textarea component with full Angular forms integration, validation state handling, readonly display mode, and optional automatic height adjustment.
It is designed to be used as an attribute selector on a textarea element.
<!-- Simple textarea -->
<textarea euiTextArea placeholder="Enter description"></textarea>
<!-- With reactive forms -->
<form [formGroup]="form">
<textarea euiTextArea formControlName="description"></textarea>
</form>
<!-- Readonly mode -->
<textarea euiTextArea [readonly]="true" [value]="content"></textarea>form = new FormGroup({
description: new FormControl('', [Validators.required, Validators.maxLength(500)])
});
OnInit
OnDestroy
DoCheck
ControlValueAccessor
| encapsulation | ViewEncapsulation.None |
| HostDirectives |
BaseStatesDirective
Inputs : euiDisabled euiDanger
|
| host | { |
| providers |
)
|
| selector | textarea[euiTextArea] |
| template | |
| styleUrl | ./eui-textarea.scss |
Properties |
|
Methods |
Inputs |
Outputs |
HostListeners |
Accessors |
constructor()
|
| e2eAttr |
Type : string
|
Default value : 'eui-textarea'
|
|
Data attribute for end-to-end testing |
| id |
Type : string
|
Default value : `eui-textarea_${EuiTextareaComponent.idCounter++}`
|
|
Unique identifier for the textarea |
| readonly |
Type : boolean, BooleanInput
|
Default value : undefined, { transform: booleanAttribute }
|
|
The readonly state of the textarea with special styling. |
| rowsChange |
Type : number
|
|
Event emitter that fires when the number of text rows in the textarea changes |
| blur | ||||||
Arguments : '$any($event.target).value'
|
||||||
blur(value: string)
|
||||||
|
Handles blur events on the textarea
Parameters :
|
| input | ||||||
Arguments : '$any($event.target).value'
|
||||||
input(value: string)
|
||||||
|
Handles input changes in the textarea
Parameters :
|
| Public onBlur | ||||||||
onBlur(value: string)
|
||||||||
Decorators :
@HostListener('blur', ['$any($event.target).value'])
|
||||||||
|
Handles blur events on the textarea
Parameters :
Returns :
void
|
| Public onInputChange | ||||||||
onInputChange(value: string)
|
||||||||
Decorators :
@HostListener('input', ['$any($event.target).value'])
|
||||||||
|
Handles input changes in the textarea
Parameters :
Returns :
void
|
| registerOnChange | ||||||||
registerOnChange(fn: () => void)
|
||||||||
|
Registers the callback function for change events
Parameters :
Returns :
void
|
| registerOnTouched | ||||||||
registerOnTouched(fn: () => void)
|
||||||||
|
Registers the callback function for touched events
Parameters :
Returns :
void
|
| setDisabledState | ||||||||
setDisabledState(isDisabled: boolean)
|
||||||||
|
Sets the disabled state of the textarea
Parameters :
Returns :
void
|
| writeValue | ||||||||
writeValue(obj: unknown)
|
||||||||
|
ControlValueAccessor implementation for writing values
Parameters :
Returns :
void
|
| Static idCounter |
Type : number
|
Default value : 0
|
|
Static counter used to generate unique IDs for textarea instances |
| class |
getclass()
|