Forms

Rich text editor

@xui/rich-text-editor

A WYSIWYG editor whose value is source text: the user formats content, the binding is the Markdown or BBCode you store. The toolbar is the format's capabilities — Markdown gets headings, a divider and inline code; BBCode gets underline instead. </> swaps the formatted view for the source text, editable, and back.

Install

pnpm add @xui/rich-text-editor

Add the barrel to a standalone component's imports:

import { XuiRichTextEditorImports } from '@xui/rich-text-editor';

@Component({
  imports: [XuiRichTextEditorImports],
  // …
})

Examples

Markdown

Loading preview…

Bbcode

Loading preview…

Empty

Loading preview…

Source view

Loading preview…

Disabled

Loading preview…

API

XuiRichTextEditor

componentxui-rich-text-editor

A WYSIWYG editor whose value is source text.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''valuetwo-waystringThe source text, in the active format. Two-way bindable, and the form value.''formatstring'markdown', 'bbcode', or any format registered with provideXuiRichTextSyntax.this.config.formatplaceholderstringText shown over the empty editor.this.config.placeholdersourceViewbooleanOffer the source-text toggle.this.config.sourceViewdisabledbooleanBlock editing and dim the editor and its toolbar.falseminHeightnumberHeight of the writing area before it grows with the content.180ariaLabelstring | undefinedAccessible name for the editing surface — what is being written.undefinedsourcetwo-waybooleanWhether the source view is showing. Two-way bindable.false

Methods

focus(): voidThe editing surface, for consumers who need to focus it.

Source

libs/ui/rich-text-editor/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.