ToolbarItem

23 Sep 20251 minute to read

Represents a toolbar item model in the block editor component.

Properties

cssClass string

Specifies additional CSS classes for styling the item.
This allows for further customization of the item’s appearance. Default is an empty string.

Defaults to ’’

disabled boolean

Specifies whether the item is disabled.
When set to true, the item is not interactive. Default is false.

Defaults to false

htmlAttributes { : }

Defines htmlAttributes used to add custom attributes to Toolbar command.
Supports HTML attributes such as style, class, etc.

Defaults to null

iconCss string

Specifies the CSS classes for the icon associated with the item.
Allows styling and representation of icons next to item headers.

Defaults to ’’

id string

Specifies the unique identifier for the toolbar item.
This property is used to uniquely identify each item.

Defaults to ’’

item BuiltInToolbar

Specifies the toolbar item type.
Supports built-in formatting options or custom commands.

Defaults to ‘Custom’

tabIndex number

Specifies the tab index of the item when it appears in a tabbing sequence.
This controls the keyboard focus order. Default is -1, indicating no focus.

Defaults to -1

template string|Object|Function

Specifies the template used for rendering the item.
It can be a string or a function returning a string, allowing for customized rendering. Default is null.

Defaults to null

text string

Specifies the text content associated with the item.
It can be used as a label or description. Default is empty.

Defaults to ’’

tooltip string

Specifies the tooltip text that appears when hovering over the item.
It provides additional information or context. Default is an empty string.

Defaults to ’’

type ItemType

Specifies the type of the item, determining its function or category.
The default type is ItemType.Button.

Defaults to ‘Button’

visible boolean

Specifies whether the item is visible.
This controls the visibility of the item in the UI. Default is true.

Defaults to true