# API of `@koobiq/components/textarea`

Documented on [Textarea](https://koobiq.io/en/components/textarea.md). NgModule: `KbqTextareaModule`.

## Directives

### KbqTextarea (directive)

```ts
@Directive({ selector: 'textarea[kbqTextarea]', exportAs: 'kbqTextarea' })
class KbqTextarea implements KbqFormFieldControl<any>, CanUpdateErrorState {
    readonly canGrow = input<boolean>(true);
    readonly maxRows = input<number | undefined>();
    readonly errorStateMatcher = input<ErrorStateMatcher>();
    readonly readonly = input<boolean>(false);
    readonly freeRowsHeight = input<number | undefined>();
    readonly ngControl: NgControl | null;
    readonly parentForm: NgForm | null;
    readonly parentFormGroup: FormGroupDirective | null;
    readonly defaultErrorStateMatcher: ErrorStateMatcher;
    readonly errorState: Signal<boolean>;
    readonly maxRowLimitReached: Signal<boolean>;
    updateErrorState(): void;
    focus(): void;
}
```

- `[canGrow]`: `boolean` — Parameter enables or disables the ability to automatically increase the height.
  If set to false, the textarea becomes vertically resizable.
- `[maxRows]`: `number | undefined` — Maximum number of lines to which the textarea will grow. Unlimited when unset.
- `[errorStateMatcher]`: `ErrorStateMatcher` — An object used to control when error messages are shown.
- `[readonly]`: `boolean` — Whether the textarea is read-only: its value can be selected and copied, but not changed. A read-only
  textarea shows no placeholder. Defaults to `false`.
- `[freeRowsHeight]`: `number | undefined` — Distance from the last line to the bottom border. Defaults to a single line height.
- `errorState`: `Signal<boolean>` — Whether the component is in an error state.
- `maxRowLimitReached`: `Signal<boolean>` — Flag that will be set to true when the maximum number of lines is reached.
  Maximum number of rows can be set using the maxRows input.
- `focus()`: `void` — Focuses the textarea.

## Constants

### KBQ_TEXTAREA_VALUE_ACCESSOR (const)

```ts
const KBQ_TEXTAREA_VALUE_ACCESSOR: InjectionToken<{ value: any }>;
```
