Sign up (with export icon)

MentionConfig

Api-interface icon interface

The configuration of the mention feature.

Read more about configuring the mention feature.

ClassicEditor
	.create( editorElement, {
		mention: ... // Mention feature options.
	} )
	.then( ... )
	.catch( ... );
Copy code

See all editor options.

Properties

  • Chevron-right icon

    commitKeys : Array<number> | undefined

    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( ... );
    
    Copy code

    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 ]

  • Chevron-right icon

    dropdownLimit : number | undefined

    The 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 20 and Infinity (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 code

    Defaults to 10

  • Chevron-right icon

    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( ... );
    
    Copy code

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