What is @ckeditor/ckeditor5-mention?
@ckeditor/ckeditor5-mention is a plugin for CKEditor 5 that allows you to implement mention functionality in your editor. This feature is commonly used to mention users, tags, or other entities within the text, similar to how mentions work on social media platforms.
What are @ckeditor/ckeditor5-mention's main functionalities?
Basic Mention
This feature allows you to add basic mention functionality to your CKEditor instance. The example code initializes the editor with a mention feed that triggers when the '@' character is typed, suggesting names like '@Anna', '@Thomas', and '@John'.
ClassicEditor.create(document.querySelector('#editor'), { mention: { feeds: [ { marker: '@', feed: ['@Anna', '@Thomas', '@John'], minimumCharacters: 1 } ] } })
Custom Mention Feed
This feature allows you to use a custom function to provide the mention feed. The example code uses a promise to simulate an asynchronous feed that filters the mention suggestions based on the query.
ClassicEditor.create(document.querySelector('#editor'), { mention: { feeds: [ { marker: '@', feed: (query) => { return new Promise(resolve => { setTimeout(() => { resolve(['@Anna', '@Thomas', '@John'].filter(item => item.includes(query))); }, 100); }); }, minimumCharacters: 1 } ] } })
Multiple Markers
This feature allows you to use multiple markers for different types of mentions. The example code initializes the editor with two mention feeds: one for '@' mentions and another for '#' tags.
ClassicEditor.create(document.querySelector('#editor'), { mention: { feeds: [ { marker: '@', feed: ['@Anna', '@Thomas', '@John'], minimumCharacters: 1 }, { marker: '#', feed: ['#Tag1', '#Tag2', '#Tag3'], minimumCharacters: 1 } ] } })
Other packages similar to @ckeditor/ckeditor5-mention
quill-mention
quill-mention is a plugin for the Quill rich text editor that provides similar mention functionality. It allows you to mention users, tags, or other entities within the text. Compared to @ckeditor/ckeditor5-mention, quill-mention is designed specifically for the Quill editor and offers similar customization options for mention feeds and markers.
draft-js-mention-plugin
draft-js-mention-plugin is a plugin for the Draft.js editor that adds mention functionality. It allows you to mention users, tags, or other entities within the text. This plugin is comparable to @ckeditor/ckeditor5-mention but is tailored for use with the Draft.js framework, offering similar features such as custom mention feeds and multiple markers.
tiptap-extensions
tiptap-extensions is a collection of extensions for the Tiptap editor, including a mention extension. It allows you to implement mention functionality similar to @ckeditor/ckeditor5-mention. The mention extension in tiptap-extensions provides customizable mention feeds and markers, making it a comparable alternative for those using the Tiptap editor.