Installation
List functionality in CKEditor 5 is provided by several plugins. This article explains how to install them.
# Ordered and unordered lists installation
The List
plugin provides the ordered (numbered) and unordered (bulleted) features for CKEditor 5. Additional list properties, such as list marker styles, start index, or reversed list order, are provided by the ListProperties
plugin.
# List feature
The list feature is enabled by default in all predefined builds. The installation instructions are for developers interested in building their own, custom rich text editor.
To add this feature to your editor, install the @ckeditor/ckeditor5-list
package:
npm install --save @ckeditor/ckeditor5-list
Then add the List
plugin to your plugin list and the toolbar configuration:
import { List } from '@ckeditor/ckeditor5-list';
ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [ List, /* ... */ ],
toolbar: [ 'bulletedList', 'numberedList', /* ... */ ]
} )
.then( /* ... */ )
.catch( /* ... */ );
# List properties
The list properties feature is enabled by default in the document editor build.
To enable the list properties feature for ordered and unordered lists, install the @ckeditor/ckeditor5-list
package:
npm install --save @ckeditor/ckeditor5-list
Then add the ListProperties
plugin to your plugin list and configure the toolbar.
To enable selected sub-features of the list properties, add their configuration to your editor. Set true
for each feature you want to enable:
import { ListProperties } from '@ckeditor/ckeditor5-list';
ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [ ListProperties, /* ... */ ],
toolbar: [ 'bulletedList', 'numberedList', /* ... */ ],
list: {
properties: {
styles: true,
startIndex: true,
reversed: true
}
}
} )
.then( /* ... */ )
.catch( /* ... */ );
The ListProperties
feature overrides UI button implementations from the ListUI
.
# To-do lists installation
The TodoList
plugin provides the to-do list feature for CKEditor 5.
The to-do list feature is enabled by default in the superbuild only.
To add this feature to your editor, install the @ckeditor/ckeditor5-list
package:
npm install --save @ckeditor/ckeditor5-list
Then add the TodoList
plugin to your plugin list and the toolbar configuration:
import { TodoList } from '@ckeditor/ckeditor5-list';
ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [ TodoList, /* ... */ ],
toolbar: [ 'todoList', /* ... */ ],
} )
.then( /* ... */ )
.catch( /* ... */ );
Read more about installing plugins.
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.