Fields

Multi Line Text

Multi Line Text is the standard textarea field.

Use this page to see the default markup and preserve the required attributes when you override templates or adapt the field to another design system.

Preview

Rich text module

Multi Line Text can also act as the transport field behind the rich-text module. In that mode, the textarea stays in the DOM as the submitted value, while the browser module mounts a Pell editor UI beside it.

Keep these rich-text attributes intact when you enable the module:

AttributeDescriptionImportance
[data-formie-rich-text]Rich-text editor mount containerRequired
textarea[data-formie-multi-line-text-input]Underlying textarea transport inputRequired
data-formie-inputGeneric input marker on the textareaRequired
data-formie-input-idStable textarea identityRequired

Events

Rich-text-enhanced Multi Line Text fields emit field events in addition to the broader events documented on JavaScript events.

The formie:field:rich-text:before-init event

Triggered before the Pell editor is created. Use this to adjust editor options before the field mounts.

js
document.addEventListener('formie:field:rich-text:before-init', (event) => {
  // Keep the toolbar minimal for a short project brief field.
  event.detail.options.actions = ['bold', 'italic', 'olist', 'ulist', 'link'];
});

The formie:field:rich-text:after-init event

Triggered after the editor instance has been attached to the field.

js
document.addEventListener('formie:field:rich-text:after-init', (event) => {
  const { richText } = event.detail;

  // Pell exposes the editable region on the editor instance.
  if (!(richText?.content instanceof HTMLElement)) {
    return;
  }

  // Mark the contenteditable surface for custom UI or analytics hooks.
  richText.content.setAttribute('data-rich-text-ready', 'true');
});

The formie:field:rich-text:populate event

Triggered after the editor content has been synchronized back into the textarea value.

js
document.addEventListener('formie:field:rich-text:populate', (event) => {
  const { richText, value } = event.detail;

  // The rich-text module keeps the textarea as the transport input.
  if (!(richText instanceof HTMLTextAreaElement)) {
    return;
  }

  // Mirror editor state onto the field wrapper for custom UI.
  richText.closest('[data-formie-field]')?.toggleAttribute('data-rich-text-has-content', value.trim().length > 0);
});

The broader module lifecycle also emits formie:module:rich-text:init and formie:module:rich-text:destroy when you need global setup or teardown hooks.

Module example

Register the rich-text field module against a Multi Line Text field target:

html
<form
  class="formie-form"
  data-formie
  data-formie-form
  data-formie-modules='[
    {
      "id": "rich-text",
      "type": "field",
      "targets": [
        {
          "targetType": "field",
          "targetId": "projectBrief"
        }
      ],
      "config": {
        "options": {
          "buttons": ["bold", "italic", "ulist", "link"]
        }
      }
    }
  ]'
>
  ...
</form>

The module looks for a field that contains both a [data-formie-rich-text] container and a textarea[data-formie-multi-line-text-input], then mounts the editor and keeps the textarea value synchronized for validation and submission.

Attributes

Multi Line Text fields span an outer field wrapper plus the actual <textarea>.

Field

AttributeDescriptionImportance
data-formie-field-handleStable field identity used by validation, conditions, calculations, and error renderingRequired
data-formie-field-type="multi-line-text"Field-type marker on the outer wrapperRecommended

Field input

AttributeDescriptionImportance
nameSubmission payload key for the textarea valueRequired
data-formie-inputGeneric Formie input marker included in normal outputRecommended
data-formie-input-idStable input identity for browser behavior and module targetingRecommended
data-formie-multi-line-text-inputTextarea selector used by text-specific enhancementsRequired for text-specific modules
data-formie-input-type="textarea"Server-rendered input-type metadataRecommended
rowsInitial control heightOptional
aria-describedbyConnects instructions and errorsRecommended

Styling classes

These classes are for presentation only. They are not behavior requirements:

Field input

ClassDescription
formie-textareaMulti Line Text textarea styling
formie-inputShared control styling and focus treatment
formie-input-errorError-state styling class

Rich text

ClassDescription
formie-rich-textPell editor mount surface for the rich-text enhancement
Last updated: May 6, 2026, 3:46 PM