Interface

SlashCommandEditorConfig (slash-command)

@ckeditor/ckeditor5-slash-command/src/slashcommandeditorconfig

interface

The configuration of the slash command feature.

Read more about configuring the slash command feature.

		ClassicEditor
			.create( editorElement, {
				slashCommand: ... // Slash command feature options.
			} )
			.then( ... )
			.catch( ... );

See all editor options.

Filtering

Properties

  • dropdownLimit : number

    The maximum number of commands displayed in the dropdown list of slash commands.

    		ClassicEditor
    			.create( editorElement, {
    				plugins: [ SlashCommand, ... ],
    				slashCommand: {
    					dropdownLimit: 4
    					// More of editor configuration.
    					// ...
    				}
    			} )
    			.then( ... )
    			.catch( ... );
    
  • extraCommands : Array<SlashCommandDefinition>

    Additional commands to be added to the list of defaults supported by the slash command feature. It allows the feature to work with third-party commands and make them appear in the user interface upon writing the slash ("/") character.

    		ClassicEditor
    			.create( editorElement, {
    				plugins: [ SlashCommand, ... ],
    				slashCommand: {
    					extraCommands: [
    						{
    							id: 'bold',
    							commandName: 'bold',
    							title: 'Bold',
    							// ...
    						},
    						// ...
    					]
    					// ...
    				}
    			} )
    			.then( ... )
    			.catch( ... );
    
  • removeCommands : Array<string>

    The list of commands to be removed from the default command list. Commands specified by this configuration will not appear in the user interface upon writing the slash ("/") character.

    • Each entry must be a unique name of a command registered in the editor's command collection.
    • Check out the list of the default commands supported by the slash command feature to learn which commands can be removed.
    		ClassicEditor
    			.create( editorElement, {
    				plugins: [ SlashCommand, ... ],
    				slashCommand: {
    					removeCommands: [ 'heading', 'paragraph', ... ]
    					// ...
    				}
    			} )
    			.then( ... )
    			.catch( ... );