Sign up (with export icon)

SlashCommandEditorConfig

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

See all editor options.

Properties

  • Chevron-right icon

    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( ... );
    
    Copy code
  • Chevron-right icon

    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( ... );
    
    Copy code
  • Chevron-right icon

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