# @equinor/fusion-wc-textarea

> # `` [![Published on npm](https://img.shields.io/npm/v/@equinor/fusion-wc-textarea.svg)](https://www.npmjs.com/package/@equinor/fusion-wc-textarea)

Latest version **1.2.4** (published 2026-08-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install @equinor/fusion-wc-textarea
pnpm add @equinor/fusion-wc-textarea
yarn add @equinor/fusion-wc-textarea
bun add @equinor/fusion-wc-textarea
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2026-08-12 |
| First published | 2021-07-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 436.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 13 |
| Author | Equinor ASA |
| Maintainers | _odin_, nogglings, eikeland |
| Keywords | text area, fusion, equinor |

## Links

- npm: https://www.npmjs.com/package/@equinor/fusion-wc-textarea
- Repository: https://github.com/equinor/fusion-web-components
- Homepage: https://github.com/equinor/fusion-web-components#readme
- Issues: https://github.com/equinor/fusion-web-components/issues
- npm.io page: https://npm.io/package/@equinor/fusion-wc-textarea

## Dependencies (4)

- [lit](https://npm.io/package/lit.md) 3.3.3
- [@material/mwc-textarea](https://npm.io/package/@material/mwc-textarea.md) ^0.27.0
- [@equinor/fusion-wc-core](https://npm.io/package/@equinor/fusion-wc-core.md) ^2.0.3
- [@equinor/fusion-wc-textinput](https://npm.io/package/@equinor/fusion-wc-textinput.md) ^1.2.4

## Recent versions

- 1.2.4 (latest) — 2026-08-12
- 0.4.21-next.1 (next) — 2023-09-20
- 1.2.3 — 2026-05-11
- 1.2.2 — 2026-05-05
- 1.2.1 — 2026-04-28
- 1.2.0 — 2026-04-20
- 1.1.4 — 2025-02-26
- 1.1.3 — 2025-02-19
- 1.1.2 — 2024-08-23
- 1.1.1 — 2024-03-15
- 1.1.0 — 2023-11-24
- 1.0.4 — 2023-10-31
- 1.0.3 — 2023-10-24
- 1.0.2 — 2023-10-17
- 1.0.1 — 2023-09-28
- … 37 more at https://npm.io/package/@equinor/fusion-wc-textarea/versions

## README

<!--prettier-ignore-start-->
# `<fusion-wc-textarea>` [![Published on npm](https://img.shields.io/npm/v/@equinor/fusion-wc-textarea.svg)](https://www.npmjs.com/package/@equinor/fusion-wc-textarea)

[Storybook](https://equinor.github.io/fusion-web-components/?path=/docs/input-textarea)

[Material Web Component](https://github.com/material-components/material-components-web-components/tree/master/packages/textarea)

## Installation
```sh
npm install @equinor/fusion-wc-textarea
```

## Example Usage

```html
<fwc-textarea label='My Label' icon="settings" rows='3' cols='4'></fwc-textarea>
```

### Properties/Attributes

Name                      | Type                          | Description
------------------------- | ----------------------------- | -----------
`value`                   | `string`                      | The input control's value.
`type`                    | `TextInputType*`              | A string specifying the type of control to render.
`variant`                 | `TextInputVariant**`          | Input style variant to render.
`label`                   | `string`                      | Sets floating label value.
`rows`                    | `number`                      | Sets number of visible text lines.
`cols`                    | `number`                      | Sets the visible width of the textarea.
`placeholder`             | `string`                      | Sets disappearing input placeholder.
`prefix`                  | `string`                      | Prefix text to display before the input.
`suffix`                  | `string`                      | Suffix text to display after the input.
`disabled`                | `boolean`                     | Whether or not the input should be disabled.
`charCounter`             | `boolean | TextInputCharCounter***`                     | **Note: requries `maxLength` to be set.** Display character counter with max length.
`helper`                  | `string`                      | Helper text to display below the input. Display default only when focused.
`helperPersistent`        | `boolean`                     | Always show the helper text despite focus.
`required`                | `boolean`                     | Displays error state if value is empty and input is blurred.
`maxLength`               | `number`                      | Maximum length to accept input.
`validationMessage`       | `string`                      | Message to show in the error color when the textarea is invalid. (Helper text will not be visible)
`pattern`                 | `string`                      | [`HTMLInputElement.prototype.pattern`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)
`min`                     | `number`\|`string`            | [`HTMLInputElement.prototype.min`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)
`max`                     | `number`\|`string`            | [`HTMLInputElement.prototype.max`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (empty string will unset attribute)
`size`                    | `number`\|`null`              | [`HTMLInputElement.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefsize) (null will unset attribute)
`step`                    | `number`\|`null`              | [`HTMLInputElement.prototype.step`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Validation-related_attributes) (null will unset attribute)
`autoValidate`            | `boolean`                     | Reports validity on value change rather than only on blur.
`validity`                | `ValidityState` (readonly)    | The [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) of the textarea.
`willValidate`            | `boolean` (readonly)          | [`HTMLInputElement.prototype.willValidate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#Properties)
`validityTransform`       | `ValidityTransform****`\|`null` | Callback called before each validation check. See the [validation section](#Validation) for more details.
`validateOnInitialRender` | `boolean`                     | Runs validation check on initial render.
`name`                    | `string`                      | Sets the `name` attribute on the internal input.\*\*\*

\*  `TextInputType` is exported by `fwc-textinput`.
```ts
type TextInputType = 'text'|'search'|'tel'|'url'|'email'|'password'|
    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';
```

\*\*  `TextInputVariant` is exported by `fwc-textinput`.
```ts
export type TextInputVariant = 'filled' | 'outlined';
```

\*\*\* `TextInputCharCounter` is exported by `fwc-textinput`.
```ts
type TextInputCharCounter = 'external' | 'internal';
```

\*\*\*\* `ValidityTransform` is exported by `fwc-textinput`.
```ts
type ValidityTransform = (value: string, nativeValidity: ValidityState) => Partial<ValidityState>
```

\*\*\*\*\* The `name` property should only be used for browser autofill as webcomponent form participation does not currently consider the `name` attribute. See [#289](https://github.com/material-components/material-components-web-components/issues/289).

### Methods

| Name     | Description
| -------- | -------------
| `checkValidity() => boolean`   | Returns `true` if the textarea passes validity checks. Returns `false` and fires an [`invalid`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event) event on the textarea otherwise. <br>**NOTE:** When accessing any property or function that checks validity at textarea initial boot up, you may have to await `<fwc-textarea>.updateComplete`.
| `reportValidity() => boolean`   | Runs `checkValidity()` method, and if it returns false, then it reports to the user that the input is invalid.
| `setCustomValidity(message:string) => void`   | Sets a custom validity message (also overwrites `validationMessage`). If this message is not the empty string, then the element is suffering from a custom validity error and does not validate.
| `layout() => Promise<void>`   | Re-calculate layout. If a textarea is styled with `display:none` before it is first rendered, and it has a label that is floating, then you must call `layout()` the first time you remove `display:none`, or else the notch surrounding the label will not render correctly.

### Validation

`<fwc-textarea>` follows the basic `<input>` [constraint validation model](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).
It exposes:

* `required`
* `maxLength`
* `pattern`
* `min`
* `max`
* `step`
* `validity`
* `willValidate`
* `checkValidity()`
* `reportValidity()`
* `setCustomValidity(message)`

Additionally, it implements more features such as:

* `validationMessage`
* `validateOnInitialRender`
* and `validityTransform`

By default, `<fwc-textarea>` will report validation on `blur`.
<!--prettier-ignore-end-->

---
_Source: https://npm.io/package/@equinor/fusion-wc-textarea · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
