# certara-textarea



<!-- Auto Generated Below -->


## Overview

A text area lets a user input a longer amount of text than a standard text field. It can include all of the standard validation options supported by the text field component.

## Properties

| Property      | Attribute     | Description                                                        | Type           | Default           |
| ------------- | ------------- | ------------------------------------------------------------------ | -------------- | ----------------- |
| `cols`        | `cols`        | Visible width of the textarea in characters.                       | `number`       | `undefined`       |
| `disabled`    | `disabled`    | Prevents user interaction.                                         | `boolean`      | `false`           |
| `maxlength`   | `maxlength`   | Maximum number of characters allowed.                              | `number`       | `undefined`       |
| `name`        | `name`        | Form control name, used for form submission and validation events. | `string`       | `this.textareaId` |
| `placeholder` | `placeholder` | Placeholder text shown when empty.                                 | `string`       | `undefined`       |
| `readonly`    | `readonly`    | Prevents editing while allowing selection and copy.                | `boolean`      | `false`           |
| `required`    | `required`    | Marks the field as required for form validation.                   | `boolean`      | `false`           |
| `rows`        | `rows`        | Number of visible text rows.                                       | `number`       | `undefined`       |
| `size`        | `size`        | Visual size variant of the textarea.                               | `"md" \| "sm"` | `'md'`            |
| `value`       | `value`       | Current value of the textarea.                                     | `string`       | `undefined`       |


## Events

| Event                     | Description                                                                                     | Type                         |
| ------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------- |
| `certaraBlur`             | Emitted when the textarea loses focus.                                                          | `CustomEvent<any>`           |
| `certaraChange`           | Emitted when value changes from the previous value.                                             | `CustomEvent<any>`           |
| `certaraFocus`            | Emitted when the textarea gains focus.                                                          | `CustomEvent<any>`           |
| `certaraFormControlError` | Emitted when validation state changes. Payload is the error message or empty string when valid. | `CustomEvent<string>`        |
| `certaraInput`            | Emitted on every keystroke.                                                                     | `CustomEvent<KeyboardEvent>` |


## Methods

### `setBlur() => Promise<void>`

Programmatically blurs the textarea.

#### Returns

Type: `Promise<void>`



### `setError(error: string) => Promise<void>`

Sets a custom error message. This allows consumers to call `textarea.setError('my error message')`.

#### Parameters

| Name    | Type     | Description                                             |
| ------- | -------- | ------------------------------------------------------- |
| `error` | `string` | The error message to display, or empty string to clear. |

#### Returns

Type: `Promise<void>`



### `setFocus() => Promise<void>`

Programmatically focuses the textarea.

#### Returns

Type: `Promise<void>`




----------------------------------------------


