Interface

MentionConfig (mention)

@ckeditor/ckeditor5-mention/src/mention

interface

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.

Filtering

Properties

  • commitKeys : Array.<Number>

    The configuration of the custom commit keys supported by the editor.

    	ClassicEditor
    		.create( editorElement, {
    			plugins: [ Mention, ... ],
    			mention: {
    				// [ Enter, Space ]
     				commitKeys: [ 13, 32 ]
    				feeds: [
    					{ ... }
    					...
    				]
    			}
    		} )
    		.then( ... )
    		.catch( ... );
    

    Custom 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 ]

  • feeds : Array.<MentionFeed>

    The list of mention feeds supported by the editor.

    ClassicEditor
    	.create( editorElement, {
    		plugins: [ Mention, ... ],
    		mention: {
    			feeds: [
    				{
    					marker: '@',
    					feed: [ '@Barney', '@Lily', '@Marshall', '@Robin', '@Ted' ]
    				},
    				...
    			]
    		}
    	} )
    	.then( ... )
    	.catch( ... );
    

    You can provide many mention feeds but they must use different markers. For example, you can use '@' to autocomplete people and '#' to autocomplete tags.