/

Editor

TUI_EDITOR_OPTIONS

#

You can also passed the default options inherited from TipTap. By default you can use a tuiEditorOptionsProvider helper to override TUI_EDITOR_OPTIONS.

    
    

Description of the available configurations:

appearance

Visual presets of interactive components

colors
map of colors in toolbar's dropdowns with color-selection.

It accepts ReadonlyMap<string, string> : the key is the name of the color (used only for hint and accessibility), the value – HTML color code.

blankColor
Null color. It is used in situations when there is no color selected.

it accepts string (HTML color code).

fontOptions
You can customize your own list of font sizes in editor.
translate
Although not all browsers recognize this attribute, it is respected by automatic translation systems such as Google Translate, and may also be respected by tools used by human translators. As such it's important that web authors use this attribute to mark content that should not be translated..
icons
You can redefine icons by names. More ->
spellcheck
Defines whether the editor may be checked for spelling errors.
enableDefaultStyles
By default, editor styles will be included without encapsulation, if you want your own styles, you can disable them.

Preserve whitespace

#

Passed content is parsed by ProseMirror. To hook into the parsing, you can pass parseOptions which are then handled by ProseMirror. By default, whitespace is collapsed as per HTML's rules. Pass true to preserve whitespace, but normalize newlines to spaces, and 'full' to preserve whitespace entirely.

test text test text 2

HTML:

test text test text 2

Text:

test text test text 2

Editor Props

#

For advanced use cases, you can pass editorProps which will be handled by ProseMirror . You can use it to override various editor events or change editor DOM element attributes, for example to add some Tailwind classes. Here is an example:

Hello world

HTML:

Hello world

Text:

<p>Hello world</p>