CommandItem
23 Sep 20251 minute to read
Represents a command item model used in the command menu of the block editor component.
Each command item defines an action that can be performed in the editor, such as inserting a block type.
Properties
disabled boolean
Specifies whether the command item is disabled.
When set to true, the command item will be unavailable for selection and execution.
Defaults to false
groupHeader string
Specifies the header text for the command item.
This provides a descriptive title or label for the item group.
Defaults to ’’
iconCss string
Specifies the CSS classes for the icon associated with the item.
This allows for styling and representation of icons that are visually linked with the item.
Defaults to ’’
id string
Specifies the unique identifier of the command item.
This ID can be used for referencing specific commands programmatically.
Defaults to ’’
label string
Specifies the display label for the command item.
This text is shown in the command menu for the user to identify the command.
Defaults to ’’
shortcut string
Specifies the keyboard shortcut for the command item.
This allows users to trigger the command using a specific key combination.
Defaults to ’’
tooltip string
Specifies the title of the item.
This serves as the primary label or heading, providing a brief description of the item’s purpose.
Defaults to ’’
type string|BlockType
Specifies the type of the command item.
Defaults to ‘Template’