Class: ToolButton

UI.Components. ToolButton


new ToolButton(properties)

Creates a new instance of ToolButton.
Parameters:
Name Type Description
properties Object An object that contains the properties of the ToolButton.
Properties
Name Type Argument Description
dataElement string <optional>
The data element of the button.
label string <optional>
The label of the button.
img string <optional>
The icon of the button.
toolName Core.Tools.ToolNames | string <optional>
The name of the tool that the button activates. Refer to: Core.Tools.ToolNames
style object <optional>
An object defining inline CSS styles for the tool button, where each key represents a CSS property and its corresponding value.
className string <optional>
String with CSS classes to be applied to the tool button, allowing additional styling and customization through external stylesheets.
Example
const toolButton = new instance.UI.Components.ToolButton({
  label: 'Pan',
  title: 'Pan the document',
  img: 'icon-header-pan',
  toolName: 'Pan',
});

Extends

Methods


setStyle(style)

Sets the style of the Item (padding, border, background, etc.)
Parameters:
Name Type Description
style Object An object that can change the CSS style of the Item component.
Inherited From: