Creates a tool button.
dataElement and toolName (required), label, img, title, onClick, color, isActive, disabled, hidden.
Replaces the inline CSS styles of the item and updates it on screen when it is already in the UI.
CSS property names (camelCase) mapped to their values.
OptionalclassExtra CSS class names added to the item's element.
OptionalcolorIcon color of the button.
Unique name of the item; used to find, show, hide or update it later.
OptionaldisabledWhether the item is disabled (rendered but not clickable).
OptionalhiddenHides the item: true always hides it; an array of screen sizes ('desktop', 'tablet', 'mobile', 'small-mobile')
hides it only on those screen sizes.
OptionalimgIcon of the button; defaults to the icon of the tool.
OptionalisWhether the button is shown as active.
OptionallabelText shown on the button, or a translation key.
OptionalonCalled when the button is clicked, in addition to activating the tool.
OptionalstyleInline CSS styles applied to the item's element.
OptionaltitleTooltip text, or a translation key that is resolved in the current language.
OptionaltoolName of the tool the button activates (a value of Core.Tools.ToolNames or a registered custom tool).
OptionaltypeItem type (for example 'customButton', 'toolButton', 'divider'); set by each subclass.
A button that activates a tool (by tool name) when clicked and shows as active while that tool is in use.
Example