MentionConfig
The configuration of the mention feature.
Read more about configuring the mention feature.
ClassicEditor
.create( editorElement, {
mention: ... // Mention feature options.
} )
.then( ... )
.catch( ... );
See all editor options.
Properties
-
commitKeys : Array<number> | undefinedmodule:mention/mentionconfig~MentionConfig#commitKeysThe configuration of the custom commit keys supported by the editor.
ClassicEditor .create( editorElement, { plugins: [ Mention, ... ], mention: { // [ Enter, Space ] commitKeys: [ 13, 32 ] feeds: [ { ... } ... ] } } ) .then( ... ) .catch( ... );Copy codeCustom commit keys configuration allows you to customize how users will confirm the selection of mentions from the dropdown list. You can add as many mention commit keys as you need. For instance, in the snippet above new mentions will be committed by pressing either Enter or Space (13 and 32 key codes respectively).
Defaults to
[ 13, 9 ] // [ Enter, Tab ] -
dropdownLimit : number | undefinedmodule:mention/mentionconfig~MentionConfig#dropdownLimitThe configuration of the custom number of visible mentions.
Customizing the number of visible mentions allows you to specify how many available elements will the users be able to see in the dropdown list. You can specify any number you see fit. For example, in the snippets below you will find the dropdownLimit set to
20andInfinity(the latter will result in showing all available mentions).ClassicEditor .create( editorElement, { plugins: [ Mention, ... ], mention: { dropdownLimit: 20, feeds: [ { ... } ... ] } } ) .then( ... ) .catch( ... ); ClassicEditor .create( editorElement, { plugins: [ Mention, ... ], mention: { dropdownLimit: Infinity, feeds: [ { ... } ... ] } } ) .then( ... ) .catch( ... );Copy codeDefaults to
10 -
feeds : Array<MentionFeed>module:mention/mentionconfig~MentionConfig#feedsThe list of mention feeds supported by the editor.
ClassicEditor .create( editorElement, { plugins: [ Mention, ... ], mention: { feeds: [ { marker: '@', feed: [ '@Barney', '@Lily', '@Marshall', '@Robin', '@Ted' ] }, ... ] } } ) .then( ... ) .catch( ... );Copy codeYou can provide many mention feeds but they must use different
markers. For example, you can use'@'to autocomplete people and'#'to autocomplete tags.