RichTextEditor

App

Quill 2.x WYSIWYG with token-tinted snow theme. Production features: controlled value (via `kui-rte:set-html` event), imperative API via `window.KuiRte.get(id)`, name+hidden-form-sync, drag-and-drop image upload (with `imageUploadFn` global override), paste sanitization (Word / GDocs cleanup), char + word counter with maxLength, autosave to localStorage, markdown shortcuts, color + highlight, sub/sup, indent/outdent, horizontal rule, tables, emoji picker, @-mentions, /-slash command menu, selection bubble menu, image resize/align overlay, fullscreen mode. Pixel-identical React sibling at modules/app/RichTextEditor/index.tsx.

Empty + counter

Preview
0 words 0

Use the toolbar — markdown shortcuts work too: try **bold** or # heading.

Code
<%- include('modules/app/RichTextEditor', {
  id: 'article-body',
  name: 'body',
  label: 'Article body',
  showCounter: true,
  showWordCount: true
}) %>

Pre-populated

Preview
Code
<%- include('modules/app/RichTextEditor', {
  id: 'release-notes',
  name: 'releaseNotes',
  label: 'Release notes',
  value: '

Release notes

...

' }) %>

Read-only

Preview

This document is read-only.

Code
<%- include('modules/app/RichTextEditor', {
  id: 'archived',
  name: 'archived',
  label: 'Archived document',
  value: savedHtml,
  readOnly: true
}) %>

Max length (200 chars)

Preview
0 / 200

Maximum 200 characters.

Code
<%- include('modules/app/RichTextEditor', {
  id: 'short-summary',
  name: 'summary',
  label: 'Short summary',
  maxLength: 200,
  showCounter: true
}) %>

Mentions + slash commands

Preview

Type @ to mention a teammate, or / to insert a block.

Code
<%- include('modules/app/RichTextEditor', {
  id: 'comment',
  name: 'comment',
  label: 'Comment',
  mentions: [
    { id: 'u1', label: 'Jane Doe', description: 'Designer' },
    { id: 'u2', label: 'John Smith', description: 'Engineer' }
  ],
  slashItems: [
    { id: 'h1',   label: 'Heading 1',   command: 'header:1' },
    { id: 'list', label: 'Bullet list', command: 'list:bullet' },
    { id: 'hr',   label: 'Divider',     command: 'hr' }
  ]
}) %>

Imperative ref API

Preview
Code
<%- include('modules/app/RichTextEditor', {
  id: 'reply', name: 'reply', value: '

Hello

' }) %>

Form integration

Preview
Code
<%- include('modules/app/RichTextEditor', { id: 'post', name: 'body', value: savedHtml }) %>

Autosave

Preview

Your changes survive page refresh — key: 'demo-draft'.

Code
<%- include('modules/app/RichTextEditor', {
  id: 'draft', name: 'draft', autosaveKey: 'my-draft'
}) %>
Source modules/app/RichTextEditor/index.ejs