# SlashCommandDefinition

interface

An object describing a single command definition in the configuration.

<a id="properties">

## Properties

<a id="member-aliases">

### `aliases?: Array<string>`

An optional list of aliases (extending the base [`id`](#member-id)) to be used when filtering the list of slash commands based on the text that follows the slash ("/") character.

<a id="member-commandName">

### `commandName?: string`

The name of the command to be executed if the `execute` property was not provided, for example, 'blockQuote', 'heading'. See [`commands`](module_core_editor_editor-Editor.md#member-commands) to learn more about available commands.

<a id="member-description">

### `description?: string`

An optional description for the command. Useful when the title is not descriptive enough.

<a id="member-execute">

### `execute?: Function`

A callback function defining custom logic for executing the command. If not provided, the default command's [`execute`](module_core_command-Command.md#function-execute) is used instead. Custom logic is useful especially when the slash command requires some arguments (acts like a wrapper) or combines some complex logic. This property is obligatory if [`commandName`](#member-commandName) was not passed.

This callback gets an [`Editor`](module_core_editor_editor-Editor.md) instance as a parameter.

<a id="member-icon">

### `icon?: string`

An SVG string representing the icon of the command. If not provided, a generic icon will be used instead. The default size of the icon is 20x20 pixels. Be sure to set the correct `viewBox` attribute in the icon source.

See [`isIconColorInherited`](#member-isIconColorInherited).

<a id="member-id">

### `id: string`

A unique ID matched with the text that follows the slash ("/") character typed by the user, e.g. 'blockQuote', 'heading1'. See [`aliases`](#member-aliases) to learn about slash command aliases that provide a similar functionality.

<a id="member-isEnabled">

### `isEnabled?: Function`

A callback function defining custom logic to decide if the command should be displayed in the dropdown list. If not provided, the default command's [`isEnabled`](module_core_command-Command.md#member-isEnabled) property is used instead. If it's also unavailable, it falls back to `true`. This property is checked when a user types the slash ("/") character or changes the text that follows it.

This callback gets an [`Editor`](module_core_editor_editor-Editor.md) instance as a parameter.

<a id="member-isIconColorInherited">

### `isIconColorInherited?: boolean`

By default, slash command icons are monochromatic and inherit the color of the text in the editor UI. Setting this property to `false` disables this inheritance and allows the use of complex (colorful) icons.

Learn more in [`isColorInherited`](module_ui_icon_iconview-IconView.md#member-isColorInherited).

<a id="member-title">

### `title: string | Function`

A meaningful title for the command displayed in a dropdown list of possible commands. It can be a string or a callback function returning a string.

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
