Skip to content

Lists & Indentation

@erag/text-editor-vue supports bulleted unordered lists (<ul>), numbered ordered lists (<ol>), nested lists, and multi-level paragraph indentation.


Toolbar Configuration

Add list and indentation controls to your init.toolbar:

ts
const editorConfig: EditorInit = {
    toolbar:
        'undo redo | blocks | bullist numlist | outdent indent | removeformat',
};

Detailed Controls

Control NameToolbar KeywordHTML Element CreatedShortcut
Bulleted Listbullist<ul><li>Item</li></ul>Standard toolbar click
Numbered Listnumlist<ol><li>Item</li></ol>Standard toolbar click
Increase IndentindentIndents current line or list item depthTab (inside list item)
Decrease IndentoutdentDecreases indentation depth or exits listShift+Tab (inside list)

Tailwind CSS Reset Fix

In projects using Tailwind CSS or CSS resets (such as Tailwind Preflight), standard browser ul list discs and ol numbers are often stripped globally by reset rules (list-style: none).

@erag/text-editor-vue solves this issue out of the box by applying package-scoped styles inside .erag-editor .erag-content. This guarantees that lists and nested levels (disc, circle, square, and decimal) render cleanly inside your editor and exported preview HTML without requiring global application CSS modifications.

Released under the MIT License. Copyright © Er Amit Gupta