Rich Text Editor

qds-rich-text-editor is a form-associated control for concise, structured narrative HTML. It uses a curated toolbar rather than exposing editor-library configuration to consumers.

Use qds-inline-rich-text only inside the QDS content-authoring canvas. That component has a canvas-specific commit event and is not a general-purpose form input.

Usage

<qds-rich-text-editor
  name="summary"
  label="Investment summary"
  placeholder="Write an investment summary…"
  required>
</qds-rich-text-editor>

Attributes

Properties and Methods

Events

CSS Parts

Full Toolbar

The full preset additionally exposes headings, a QDS font dialog, a QDS text color picker, alignment, indentation, superscript, subscript, and code blocks. The font dialog applies its selected family, size, emphasis, and text color to the current selection. Tables, file uploads, embedded media, and footnotes are deliberately not included in this preset.

Floating Toolbar

Use the floating toolbar when the editor sits inside a constrained canvas or dialog. It preserves the text selection while using formatting controls and the QDS font and color dialogs. The toolbar appears while the editor is active; readonly and disabled controls do not expose it.

When nested in another component’s Shadow DOM, the editor preserves native text selections in Chromium and Safari, including touch formatting and caret position after typing. Escape from the toolbar returns focus to the editor.

<qds-rich-text-editor
  label="Page content"
  toolbar="full"
  floating-toolbar>
</qds-rich-text-editor>

Existing form editors keep their inline toolbar unless floating-toolbar is specified. Content designer rich-text blocks use the full floating toolbar automatically.

Form Example

<form>
  <qds-rich-text-editor
    name="committeeSummary"
    label="Committee summary"
    required
    error-text="A committee summary is required.">
  </qds-rich-text-editor>
  <button type="submit">Save</button>
</form>