Developer Programs

Learn

Docs

Rich Text Input

Components > Editing Data > Rich Text Input
Use this component to...
Prompt the user for “rich text”

Overview

Use the rich text input component to prompt the user for “rich text”, which is text with basic formatting embedded. Typical formatting options include bold, italic, underline, font face/color/weight, lists, links, etc.

Jodit editor used for editing rich text
Jodit Editor example

Development

Web component development

Component reference

jodit
jodit
Package: jodit

Allows user to edit rich text

View the jodit reference doc

Implementation

Begin by adding a textarea element with an id.

Add textarea
<textarea id="jodit-editor" name="editor" formControlName="name"></textarea>

Include jodit in package.json, where x.y.z is the currently supported version number for this framework specified here. Use npm install to install this framework.

Package dependency
"dependencies": {
    ...
    "jodit": "x.y.z",
    ...
},

Next, update the JS and CSS bundles in the angular.json file to include these assets.

Configure bundle assets
"styles": [
    ...
    "node_modules/jodit/build/jodit.min.css",
    ...
],
"scripts": [
    ...
    "node_modules/jodit/build/jodit.min.js"
]

In the typescript, create an HTMLTextAreaElement and assign it to a new Jodit object, sending in the id of the textarea, in the AfterViewInit lifecycle hook.

Configure bundle assets
public richTextEditor: HTMLTextAreaElement;

declare var Jodit: any;

...

ngAfterViewInit(): void {
    this.richTextEditor = new Jodit('#jodit-editor', {});
}

Angular component development

Component reference

jodit
jodit
Package: jodit

Allows user to edit rich text

View the jodit reference doc

Implementation

Begin by adding a textarea element with an id.

Add textarea
<textarea id="jodit-editor" name="editor" formControlName="name"></textarea>

Include jodit in package.json, where x.y.z is the currently supported version number for this framework specified here. Use npm install to install this framework.

Package dependency
"dependencies": {
    ...
    "jodit": "x.y.z",
    ...
},

Next, update the JS and CSS bundles in the angular.json file to include these assets.

Configure bundle assets
"styles": [
    ...
    "node_modules/jodit/build/jodit.min.css",
    ...
],
"scripts": [
    ...
    "node_modules/jodit/build/jodit.min.js"
]

In the typescript, create an HTMLTextAreaElement and assign it to a new Jodit object, sending in the id of the textarea, in the AfterViewInit lifecycle hook.

Configure bundle assets
public richTextEditor: HTMLTextAreaElement;

declare var Jodit: any;

...

ngAfterViewInit(): void {
    this.richTextEditor = new Jodit('#jodit-editor', {});
}

Design

Figma design

Figma design info
You can find this component in the Components - Forms page in the Figma UI Kit.
Dev ComponentDesign Component Name
Rich text editorRUI / Forms / Rich Text Editor

Adobe XD design

Adobe XD design info
You can find this component in these artboards in the Adobe XD design samples:
  • Sample App - Editing Form Data
Dev ComponentDesign Component Name
Rich text editorJHA / Forms / Rich Text Editor

Support options
Have questions on this topic?
Join the Responsive UI team in Microsoft Teams to connect with the community.
See something in this page that needs to change?
Send us feedback on this page.
Last updated Wed Apr 19 2023