Skip to content

Rich Text Input

The Rich Text Input provides a versatile editor for creating and editing formatted text content. It supports headings, lists, tables, links, mentions, and extensive formatting options. You can use it as an editor for content creation or in read-only mode for displaying rich text.

Features

  • Rich Formatting: Bold, italic, underline, strikethrough, and text colors
  • Text Structure: Headings (H1-H6), paragraphs, lists, and blockquotes
  • Advanced Elements: Tables, links, images, and code blocks
  • Mention System: Tag users or entities with customizable mention lists
  • Multiple Output Formats: HTML or Markdown output
  • Custom Styling: Style each element type independently
  • Custom Menu: Build your own editing toolbar
  • Form Integration: Works seamlessly with form validation
  • Read-Only Mode: Display formatted content without editing capabilities

Getting Started

Using AI

The quickest way to set up a rich text input is by using AI:

  1. Ask AI to add the rich text input with specific requirements:

    • "Add a rich text editor for blog post content"
    • "Create a rich text input with mentions enabled for user tagging"
    • "Add a minimal rich text editor with only basic formatting"
  2. Continue refining by asking for specific features:

    • "Enable mentions with user data from my users collection"
    • "Add table support to the rich text editor"
    • "Style the headings to match my design system"

Manual Setup

  1. Add a Rich Text Input element from the Add panel
  2. Configure basic settings:
    • Set initial content in the Init value property
    • Choose output format (HTML or Markdown)
    • Enable or disable editing mode
  3. Configure mentions (optional):
    • Enable Mentions toggle
    • Bind Mentions List to your user data
    • Map ID and Label properties
  4. Customize the toolbar:
    • Show/hide specific formatting options
    • Enable custom menu for complete control
  5. Style different text elements:
    • Configure heading styles (H1-H6)
    • Style paragraphs, links, and mentions
    • Customize table and code block appearance

Working With Content

Content Creation

The rich text editor provides an intuitive interface for content creation:

Rich text input in read and editing mode

Users can:

  • Type and format text with the toolbar
  • Use keyboard shortcuts for common formatting
  • Insert tables, links, and other elements
  • Tag users with the mention system

Markdown Support

The editor supports markdown input, allowing users to type markdown syntax that gets converted to rich formatting:

Rich text input in action

Output Formats

Choose between two output formats:

  • HTML: Structured HTML output perfect for web display
  • Markdown: Clean markdown format for storage or processing

Math Support

The rich text editor supports LaTeX mathematical expressions for both inline and block math:

Inline Math: Use for mathematical expressions within text, like variables or simple formulas. For example, you can write about the famous equation E=mc² or mention that the area of a circle is πr².

Inline Math

Block Math: Use for complex equations or formulas that need to be displayed prominently. Perfect for mathematical proofs, complex formulas, or scientific equations:

∫₀^∞ e^(-x²) dx = √π/2

Block Math

You can insert math using:

  • The toolbar buttons (when enabled)
  • Component actions: Insert Inline Math and Insert Block Math

Math Rendering

Math expressions are rendered using LaTeX syntax. Common examples include:

  • Fractions: \frac{a}{b}
  • Superscripts: x^2
  • Subscripts: x_1
  • Greek letters: \alpha, \beta, \pi
  • Integrals: \int_a^b f(x) dx

Mentions System

Enable user tagging and mentions within the rich text content:

Mentions in the rich text input

Setting Up Mentions

  1. Enable the Mentions toggle in settings
  2. Bind Mentions List to your user data collection
  3. Map the ID and Label properties to the correct fields in your data
  4. Configure mention settings:
    • Char trigger: Character that triggers mentions (default: @)
    • Allow spaces: Whether mention searches can include spaces
    • Numbers of suggestion: How many suggestions to show

Custom Menu

Create your own editing toolbar with complete design control:

Rich text input custom menu

Enabling Custom Menu

  1. Toggle on Custom menu in the design settings
  2. Design your custom toolbar in the custom menu container
  3. Add buttons and connect them to rich text actions

Rich text input custom editing menu

Available Actions

Use the Execute component action workflow action to trigger formatting:

Rich text component actions

Rich text component actions in action

Saving Content

Create workflows to save rich text content to your backend:

Display rich text variable

Use the Rich text - value variable to access the formatted content and send it to your database or API.

Forking

While the Rich Text Input offers extensive customization options, you can fork it for specialized requirements like custom formatting options or integration with specific editors.

If you are unsure how to fork an element, learn more in the dedicated documentation.

Properties Reference

Settings

PropertyOptions/TypeDescription
Read onlybooleanWhether the editor is read-only
EditablebooleanWhether the editor allows editing
Init valuetextInitial content for the editor
Outputhtml markdownFormat of the output content
PlaceholdertextPlaceholder text when editor is empty
AutofocusbooleanWhether to focus the editor on page load
DebouncebooleanEnable debounced change events
Delaylength in msDebounce delay (1-5000ms)

Mention Settings

PropertyOptions/TypeDescription
MentionsbooleanEnable mention functionality
Mentions ListarrayCollection of users/items for mentions
Id propertypathField to use as mention ID
Label propertypathField to use as mention display label
Char triggertextCharacter that triggers mentions (default: @)
Allow spacesbooleanWhether mentions can include spaces
Numbers of suggestionnumberMaximum mention suggestions to show
PropertyOptions/TypeDescription
Hide menubooleanHide the default formatting menu
Wrap menubooleanAllow menu to wrap to multiple lines
Custom menubooleanUse custom menu instead of default

Toolbar Options

When not using custom menu, control which tools are available:

PropertyOptions/TypeDescription
Text typeShow HideShow/hide heading and paragraph options
BoldShow HideShow/hide bold formatting
ItalicShow HideShow/hide italic formatting
UnderlineShow HideShow/hide underline formatting
StrikeShow HideShow/hide strikethrough formatting
Text colorShow HideShow/hide text color picker
Bullet listShow HideShow/hide bullet list option
Ordered listShow HideShow/hide numbered list option
Check listShow HideShow/hide task list option
LinkShow HideShow/hide link insertion
ImageShow HideShow/hide image insertion
Code blockShow HideShow/hide code block option
QuoteShow HideShow/hide blockquote option
TableShow HideShow/hide table insertion
Inline mathShow HideShow/hide inline math (LaTeX)
Block mathShow HideShow/hide block math (LaTeX)
UndoShow HideShow/hide undo button
RedoShow HideShow/hide redo button

Styling

PropertyDescription
Menu colorColor of the default formatting menu

Text Elements

Each text element can be styled independently:

Headings (H1-H6)

PropertyDescription
Font SizeSize of the heading text
Font FamilyFont family for headings
Font WeightWeight/boldness of heading text
Text AlignAlignment of heading text
ColorColor of heading text
Line HeightLine spacing for headings
Margin TopTop margin for headings
Margin BottomBottom margin for headings

Paragraphs (P)

PropertyDescription
Font SizeSize of paragraph text
Font FamilyFont family for paragraphs
Font WeightWeight of paragraph text
Text AlignAlignment of paragraph text
ColorColor of paragraph text
Line HeightLine spacing for paragraphs
Margin TopTop margin for paragraphs
Margin BottomBottom margin for paragraphs

Links (A)

PropertyDescription
Font SizeSize of link text
Font FamilyFont family for links
ColorColor of link text
UnderlineWhether links are underlined

Mentions

PropertyDescription
Font SizeSize of mention text
Font FamilyFont family for mentions
Font WeightWeight of mention text
ColorColor of mention text
BorderBorder width for mention badges
Border RadiusRoundness of mention badges

Blockquotes

PropertyDescription
Text ColorColor of blockquote text
Blockquote ColorColor of blockquote border
Margin TopTop margin for blockquotes
Margin BottomBottom margin for blockquotes

Code Blocks

PropertyDescription
Font SizeSize of code text
Text ColorColor of code text
Blockquote ColorBackground color of code blocks
Border RadiusRoundness of code block corners
Padding XHorizontal padding inside code blocks
Padding YVertical padding inside code blocks

Images

PropertyDescription
Max WidthMaximum width of images
Max HeightMaximum height of images
InlineWhether images display inline with text

Checkboxes

PropertyDescription
Accent ColorColor of checkbox elements

Tables

PropertyDescription
Border ColorColor of table borders
Border WidthWidth of table borders
Header Background ColorBackground color of table headers
Header Text ColorText color of table headers
Pair Row Background ColorBackground color of even rows
Impair Row Background ColorBackground color of odd rows
Cell Text ColorText color of table cells
Cell Padding YVertical padding in table cells
Cell Padding XHorizontal padding in table cells

Slots

SlotDescription
Custom Menu ElementContainer for custom menu when Custom menu is enabled

Component Actions

ActionDescriptionParameters
Focus Rich textFocus the editorNone
Set LinkAdd a link to selected textURL (Text)
Set ImageInsert an imageSource (Text), Alt (Text), Title (Text)
Set TagChange text tagTag (select: p, h1, h2, h3, h4, h5, h6)
Toggle BoldToggle bold formattingNone
Toggle ItalicToggle italic formattingNone
Toggle UnderlineToggle underline formattingNone
Toggle StrikeToggle strikethrough formattingNone
Set Text AlignSet text alignmentAlignment (select: left, center, right, justify)
Set ColorSet text colorColor (color)
Toggle Bullet ListToggle bullet listNone
Toggle Ordered ListToggle numbered listNone
Toggle Check ListToggle task listNone
Toggle Code BlockToggle code blockNone
Toggle BlockquoteToggle blockquoteNone
Insert Inline MathInsert inline LaTeXInline LaTeX Expression (Text)
Insert Block MathInsert block LaTeXBlock LaTeX Expression (Text)
UndoUndo last actionNone
RedoRedo last actionNone
Insert TableInsert a tableNone
Insert RowInsert table rowPosition (select: before, after)
Insert ColumnInsert table columnPosition (select: before, after)
Delete RowDelete table rowNone
Delete ColumnDelete table columnNone
Delete TableDelete entire tableNone

Event Triggers

EventDescriptionPayload
On changeTriggered when content changes{ value: string }
On init value changeTriggered when initial value changes{ value: string }
On mention clickTriggered when a mention is clicked{ mention: { id: string, label: string } }
On focusTriggered when editor receives focus{ value: string }
On blurTriggered when editor loses focus{ value: string }

Example Event Payloads

On change

javascript
{
  value: "<p>Hello <strong>world</strong>!</p>"
}

On mention click

javascript
{
  mention: {
    id: "user123",
    label: "John Smith"
  }
}

On focus/blur

javascript
{
  value: "<p>Current editor content</p>"
}

Exposed Variables

The rich text input exposes the following variables for use in your application:

VariableTypeDescription
valuestringCurrent HTML or Markdown content of the editor
mentionsarrayList of mentions found in the content
statesobjectCurrent formatting states of the editor

Example Variable Values

value

javascript
"<p>Hello <strong>world</strong>! Check out this <a href='https://example.com'>link</a>.</p>"

mentions

javascript
[
  {
    id: "user123",
    label: "John Smith"
  },
  {
    id: "user456", 
    label: "Jane Doe"
  }
]

states

javascript
{
  textType: "paragraph",
  textColor: "#000000",
  bold: false,
  italic: true,
  underline: false,
  strike: false,
  bulletList: false,
  orderedList: false,
  checkList: false,
  link: false,
  codeBlock: false,
  blockquote: false,
  textAlign: "left",
  table: false
}

Variable Usage

Use the value variable to save content to your backend, the mentions array for notification systems, and the states object to create custom toolbar indicators.