# @equinor/fusion-react-textarea

> component for displaying text area

Latest version **1.0.7** (published 2026-07-28) · ISC license · 0 weekly downloads

## Install

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

## Health

**Score 60/100 (C)** — status: active.

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2026-07-28 |
| First published | 2021-07-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 10 |
| Maintainers | _odin_, nogglings, eikeland |
| Keywords | text area, react, fusion, equinor |

## Links

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

## Dependencies (2)

- [@equinor/fusion-react-utils](https://npm.io/package/@equinor/fusion-react-utils.md) 3.0.7
- [@equinor/fusion-wc-textarea](https://npm.io/package/@equinor/fusion-wc-textarea.md) ^1.2.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2026-07-28
- 0.5.14-313.0 (313) — 2022-06-29
- 0.5.9-248.0 (248) — 2022-04-12
- 0.5.2-filter.7 (filter) — 2021-10-28
- 1.0.6 — 2026-06-24
- 1.0.5 — 2026-06-23
- 1.0.4 — 2026-06-23
- 1.0.3 — 2026-04-30
- 1.0.2 — 2026-04-28
- 1.0.1 — 2026-04-20
- 1.0.0 — 2025-10-17
- 0.6.5 — 2025-06-10
- 0.6.4 — 2025-02-26
- 0.6.3 — 2025-02-26
- 0.6.2 — 2025-02-19
- … 37 more at https://npm.io/package/@equinor/fusion-react-textarea/versions

## README

<!--prettier-ignore-start-->
# @equinor/fusion-react-textarea

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

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

[Fusion Web Component](https://github.com/equinor/fusion-web-components/tree/main/packages/textarea)

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

### Example Usage

```tsx
<TextArea label='My Label' rows='3' cols='4'>Hello world!</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 `TextArea`.

```ts
type TextInputType = 'text'|'search'|'tel'|'url'|'email'|'password'|
    'date'|'month'|'week'|'time'|'datetime-local'|'number'|'color';
```

\*\*  `TextInputVariant` is exported by `TextArea`.

```ts
export type TextInputVariant = 'filled' | 'outlined';
```

\*\*\* `TextInputCharCounter` is exported by `TextArea`.

```ts
type TextInputCharCounter = 'external' | 'internal';
```

\*\*\*\* `ValidityTransform` is exported by `TextArea`.

```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 `<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

`<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, `<TextArea>` will report validation on `blur`.
<!--prettier-ignore-end-->

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