# EuiMaxLengthDirective

**Type:** directive



A directive that adds maxLength functionality to input and textarea elements with visual feedback.
It shows the remaining characters count and provides visual indication when the limit is reached.


```html
```HTML
<!-- Basic usage -->
<input [euiMaxlength]="50">
```
<!-- With form control -->
<input [formControlName]="'name'" [euiMaxlength]="100">

<!-- Hide maxlength indicator -->
<textarea [euiMaxlength]="200" [isShowMaxlength]="false"></textarea>
```



**Selector:** `
    input[euiMaxlength],
    textarea[euiMaxlength],
    [ngModel][euiMaxlength],
    [formControlName][euiMaxlength]`

## Inputs
- **euiMaxlength**: `number` - 
- **isShowMaxlength**: `boolean` - 

## Outputs
- **maxLengthReached**: `EventEmitter<boolean>` - Emits when the input value length reaches or exceeds the maxLength limit. Emits true when a limit is reached, false when below limit.
