Quick start
AddSlashCommand with the default command set:
/ in the editor to open the command menu. Use arrow keys to navigate and Enter to select.
Default commands
ThedefaultSlashCommands array includes these built-in commands:
Each command is also exported individually, so you can cherry-pick:
Adding custom commands
Create aSlashCommandItem and include it in the items array:
SlashCommandItem interface:
Function called when the command is selected. Receives the editor instance and the range to replace.
Using individual commands
You can cherry-pick from the default commands to show only specific options:Controlling visibility
Function to control when the command menu can appear. Return
false to prevent it.Examples
See slash commands in action with a runnable example:Slash Commands
Default commands plus a custom Greeting command.