# @commercetools-uikit/localized-multiline-text-field

> A controlled text input component for localized multi-line strings with validation states.

Latest version **20.6.7** (published 2026-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @commercetools-uikit/localized-multiline-text-field
pnpm add @commercetools-uikit/localized-multiline-text-field
yarn add @commercetools-uikit/localized-multiline-text-field
bun add @commercetools-uikit/localized-multiline-text-field
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 20.6.7 |
| Published | 2026-07-17 |
| First published | 2019-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 13 |
| Unpacked size | 57.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 154 |
| Maintainers | emmenko, commercetools-admin, tdeekens |
| Keywords | javascript, typescript, design-system, react, uikit |

## Links

- npm: https://www.npmjs.com/package/@commercetools-uikit/localized-multiline-text-field
- Repository: https://github.com/commercetools/ui-kit
- Homepage: https://uikit.commercetools.com
- Issues: https://github.com/commercetools/ui-kit/issues
- npm.io page: https://npm.io/package/@commercetools-uikit/localized-multiline-text-field

## Dependencies (13)

- [react-intl](https://npm.io/package/react-intl.md) ^7.1.4
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.20.13
- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.10.5
- [@emotion/styled](https://npm.io/package/@emotion/styled.md) ^11.10.5
- [@babel/runtime-corejs3](https://npm.io/package/@babel/runtime-corejs3.md) ^7.20.13
- [@commercetools-uikit/utils](https://npm.io/package/@commercetools-uikit/utils.md) ^20.6.7
- [@commercetools-uikit/spacings](https://npm.io/package/@commercetools-uikit/spacings.md) ^20.6.7
- [@commercetools-uikit/constraints](https://npm.io/package/@commercetools-uikit/constraints.md) ^20.6.7
- [@commercetools-uikit/field-label](https://npm.io/package/@commercetools-uikit/field-label.md) ^20.6.7
- [@commercetools-uikit/field-errors](https://npm.io/package/@commercetools-uikit/field-errors.md) ^20.6.7
- [@commercetools-uikit/design-system](https://npm.io/package/@commercetools-uikit/design-system.md) ^20.6.7
- [@commercetools-uikit/field-warnings](https://npm.io/package/@commercetools-uikit/field-warnings.md) ^20.6.7
- [@commercetools-uikit/localized-multiline-text-input](https://npm.io/package/@commercetools-uikit/localized-multiline-text-input.md) ^20.6.7

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

- 20.6.7 (latest) — 2026-07-17
- 0.0.0-canary-20260831181816 (canary) — 2026-08-31
- 0.0.0-FEC-938-ui-kit-post-pnpm-tooling-polish-catalogs-bundlewatch-bundlesize-20260518121756 (FEC-938-ui-kit-post-pnpm-tooling-polish-catalogs-bundlewatch-bundlesize) — 2026-05-18
- 0.0.0-migration-pnpm-20260513114959 (migration-pnpm) — 2026-05-13
- 0.0.0-CRAFT-2040-rich-text-input-destroys-hyperlink-tag-20260219190637 (CRAFT-2040-rich-text-input-destroys-hyperlink-tag) — 2026-02-19
- 0.0.0-fec-155-react-19-20250528075244 (fec-155-react-19) — 2025-05-28
- 0.0.0-FCT-1500-adjust-legacy-css-reset-20250527090339 (FCT-1500-adjust-legacy-css-reset) — 2025-05-27
- 0.0.0-SUPPORT-32352-de-ch-money-input-20250509174254 (SUPPORT-32352-de-ch-money-input) — 2025-05-09
- 0.0.0-main-20250115172531 (main) — 2025-01-15
- 0.0.0-preview-fec-155-react-19-20250113184401 (preview-fec-155-react-19) — 2025-01-13
- 0.0.0-preview-test-icon-entrypoints-20241212201418 (preview-test-icon-entrypoints) — 2024-12-12
- 0.0.0-preview-test-icon-pure-annotations-20241211181046 (preview-test-icon-pure-annotations) — 2024-12-11
- 0.0.0-preview-test-icon-bundle-20241210182318 (preview-test-icon-bundle) — 2024-12-10
- 0.0.0-preview-test-canary-preview-20241204111237 (preview-test-canary-preview) — 2024-12-04
- 0.0.0-preview-FCT-1187-20241024123200 (preview) — 2024-10-24
- … 1194 more at https://npm.io/package/@commercetools-uikit/localized-multiline-text-field/versions

## README

<!-- THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -->
<!-- This file is created by the `pnpm generate-readme` script. -->

# LocalizedMultilineTextField

## Description

A controlled text input component for localized multi-line strings with validation states.

## Installation

```
pnpm add @commercetools-uikit/localized-multiline-text-field
```

```
npm --save install @commercetools-uikit/localized-multiline-text-field
```

Additionally install the peer dependencies (if not present)

```
pnpm add react
```

```
npm --save install react
```

## Usage

```jsx
import LocalizedMultilineTextField from '@commercetools-uikit/localized-multiline-text-field';

const Example = () => (
  <LocalizedMultilineTextField
    title="Description"
    value={{
      en: 'Parrot that knows how to party',
      de: 'Papagei der ordentlich abfeiert',
    }}
    selectedLanguage="en"
    onChange={(event) => alert(event.target.value)}
  />
);

export default Example;
```

## Properties

| Props                           | Type                                                                                         | Required | Default   | Description                                                                                                                                                                                                                                                                                                    |
| ------------------------------- | -------------------------------------------------------------------------------------------- | :------: | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                            | `string`                                                                                     |          |           | Used as HTML id property. An id is auto-generated when it is not specified.                                                                                                                                                                                                                                    |
| `horizontalConstraint`          | `union`<br/>Possible values:<br/>`, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto'` |          | `'scale'` | Horizontal size limit of the input fields.                                                                                                                                                                                                                                                                     |
| `errors`                        | `Record`                                                                                     |          |           | A map of errors. Error messages for known errors are rendered automatically.&#xA;<br />&#xA;Unknown errors will be forwarded to `renderError`                                                                                                                                                                  |
| `renderError`                   | `Function`<br/>[See signature.](#signature-rendererror)                                      |          |           | Called with custom errors. This function can return a message which will be wrapped in an ErrorMessage. It can also return null to show no error.                                                                                                                                                              |
| `warnings`                      | `Record`                                                                                     |          |           | A map of warnings. Warning messages for known warnings are rendered automatically.&#xA;<br/>&#xA;Unknown warnings will be forwarded to renderWarning.                                                                                                                                                          |
| `renderWarning`                 | `Function`<br/>[See signature.](#signature-renderwarning)                                    |          |           | Called with custom warnings, as renderWarning(key, warning). This function can return a message which will be wrapped in a WarningMessage.&#xA;<br />&#xA;It can also return null to show no warning.                                                                                                          |
| `additionalInfo`                | `TLocalizedMultilineTextInputProps['additionalInfo']`                                        |          |           | An object mapping locales to additional messages to be rendered below each input element.&#xA;Example:&#xA;{&#xA;en: 'Some value',&#xA;es: 'Algún valor',&#xA;}                                                                                                                                                |
| `isRequired`                    | `boolean`                                                                                    |          |           | Indicates if the value is required. Shows an the "required asterisk" if so.                                                                                                                                                                                                                                    |
| `touched`                       | `boolean`                                                                                    |          |           | Indicates whether the field was touched. Errors will only be shown when the field was touched.                                                                                                                                                                                                                 |
| `autoComplete`                  | `string`                                                                                     |          |           | Used as HTML `autocomplete` property                                                                                                                                                                                                                                                                           |
| `name`                          | `string`                                                                                     |          |           | Used as HTML `name` property for each input field. Each input field name will have the language as a suffix (`${namePrefix}.${lang}`), e.g. `foo.en`                                                                                                                                                           |
| `value`                         | `Object`<br/>[See signature.](#signature-value)                                              |    ✅    |           | Values to use. Keyed by language, the values are the actual values, e.g. `{ en: 'Horse', de: 'Pferd' }`&#xA;<br />&#xA;The input doesn't accept a "languages" prop, instead all possible&#xA;languages have to exist (with empty or filled strings) on the value:&#xA;<br />&#xA;{ en: 'foo', de: '', es: '' } |
| `onChange`                      | `ChangeEventHandler`                                                                         |          |           | Gets called when any input is changed. Is called with the change event of the changed input.                                                                                                                                                                                                                   |
| `selectedLanguage`              | `string`                                                                                     |    ✅    |           | Specifies which language will be shown in case the `LocalizedTextInput` is collapsed.                                                                                                                                                                                                                          |
| `onBlur`                        | `FocusEventHandler`                                                                          |          |           | Called when input is blurred                                                                                                                                                                                                                                                                                   |
| `onFocus`                       | `Function`<br/>[See signature.](#signature-onfocus)                                          |          |           | Called when input is focused                                                                                                                                                                                                                                                                                   |
| `defaultExpandMultilineText`    | `boolean`                                                                                    |          |           | Expands input components holding multiline values instead of collapsing them by default.                                                                                                                                                                                                                       |
| `cacheMeasurements`             | `boolean`                                                                                    |          | `true`    | Use this property to turn off caching input measurements.                                                                                                                                                                                                                                                      |
| `hideLanguageExpansionControls` | `boolean`                                                                                    |          |           | Will hide the language expansion controls when set to `true`. All languages will be shown when set to `true`.                                                                                                                                                                                                  |
| `defaultExpandLanguages`        | `boolean`                                                                                    |          |           | Controls whether one or all languages are visible by default. Pass `true` to show all languages by default.                                                                                                                                                                                                    |
| `isAutofocussed`                | `boolean`                                                                                    |          |           | Sets the focus on the first input when `true` is passed.                                                                                                                                                                                                                                                       |
| `isCondensed`                   | `boolean`                                                                                    |          |           | Whether the text inputs for each localization should render with condensed paddings.                                                                                                                                                                                                                           |
| `isDisabled`                    | `boolean`                                                                                    |          |           | Disables all input fields.                                                                                                                                                                                                                                                                                     |
| `isReadOnly`                    | `boolean`                                                                                    |          |           | Disables all input fields and shows them in read-only mode.                                                                                                                                                                                                                                                    |
| `placeholder`                   | `Object`<br/>[See signature.](#signature-placeholder)                                        |          |           | Placeholders for each language. Object of the same shape as `value`.                                                                                                                                                                                                                                           |
| `errorsByLanguage`              | `Object`<br/>[See signature.](#signature-errorsbylanguage)                                   |          |           | Errors for each translation. These are forwarded to the `errors` prop of `LocalizedTextInput`.                                                                                                                                                                                                                 |
| `title`                         | `union`<br/>Possible values:<br/>`string , ReactNode`                                        |    ✅    |           | Title of the label                                                                                                                                                                                                                                                                                             |
| `hint`                          | `union`<br/>Possible values:<br/>`string , ReactNode`                                        |          |           | Hint for the label. Provides a supplementary but important information regarding the behaviour of the input (e.g warn about uniqueness of a field, when it can only be set once), whereas description can describe it in more depth. Can also receive a hintIcon.                                              |
| `description`                   | `union`<br/>Possible values:<br/>`string , ReactNode`                                        |          |           | Provides a description for the title.                                                                                                                                                                                                                                                                          |
| `onInfoButtonClick`             | `Function`<br/>[See signature.](#signature-oninfobuttonclick)                                |          |           | Function called when info button is pressed. Info button will only be visible when this prop is passed.                                                                                                                                                                                                        |
| `hintIcon`                      | `ReactElement`                                                                               |          |           | Icon to be displayed beside the hint text. Will only get rendered when hint is passed as well.                                                                                                                                                                                                                 |
| `badge`                         | `ReactNode`                                                                                  |          |           | Badge to be displayed beside the label. Might be used to display additional information about the content of the field (E.g verified email)                                                                                                                                                                    |

## Signatures

### Signature `renderError`

```ts
(key: string, error?: boolean) => ReactNode;
```

### Signature `renderWarning`

```ts
(key: string, warning?: boolean) => ReactNode;
```

### Signature `value`

```ts
{
  [key: string]: string;
}
```

### Signature `onFocus`

```ts
() => void
```

### Signature `placeholder`

```ts
{
  [key: string]: string;
}
```

### Signature `errorsByLanguage`

```ts
{
  [key: string]: ReactNode;
}
```

### Signature `onInfoButtonClick`

```ts
() => void
```

## `data-*` props

The component further forwards all `data-` attributes to the underlying `input` component.

## `errors`

This object is a key-value map. The `renderError` prop will be called for each entry with the key and the value. The return value will be rendered inside an `ErrorMessage` component underneath the input.

The `LocalizedMultilineTextField` supports some errors out of the box. Return `undefined` from `renderError` for these and the default errors will be shown instead. This prevents consumers from having to reimplement the same error messages for known errors while still keeping the flexibility of showing custom error messages for them.

When the `key` is known, and when the value is truthy, and when `renderError` returned `undefined` for that error entry, then the `LocalizedMultilineTextField` will render an appropriate error automatically.

Known error keys are:

- `missing`: tells the user that this field is required

## Static methods

### `LocalizedMultilineTextField.toFieldErrors`

Use this function to convert the Formik `errors` object type to our custom field errors type. This is primarily useful when using TypeScript.

```ts
type FormValues = {
  myField: string;
};

<LocalizedMultilineTextField
  // ...
  name="my-field"
  errors={
    LocalizedMultilineTextField.toFieldErrors<FormValues>(formik.errors).myField
  }
/>;
```

---
_Source: https://npm.io/package/@commercetools-uikit/localized-multiline-text-field · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
