Skip to content

@serenity-is/corelib / ToolButton

Interface: ToolButton

Defined in: src/ui/widgets/toolbar.tsx:32

A toolbar button definition, extending ToolButtonProps with hotkey and separator support.

Extends

Properties

action?

optional action: string

Defined in: src/ui/widgets/toolbar.tsx:9

Optional action name stored on the button's data-action attribute.

Inherited from

ToolButtonProps.action


cssClass?

optional cssClass: string

Defined in: src/ui/widgets/toolbar.tsx:15

Optional CSS class(es) applied to the button.

Inherited from

ToolButtonProps.cssClass


disabled?

optional disabled: boolean | () => boolean

Defined in: src/ui/widgets/toolbar.tsx:25

Whether the button is disabled; may be a function evaluated on update.

Inherited from

ToolButtonProps.disabled


hint?

optional hint: string

Defined in: src/ui/widgets/toolbar.tsx:13

Optional tooltip hint shown on hover.

Inherited from

ToolButtonProps.hint


hotkey?

optional hotkey: string

Defined in: src/ui/widgets/toolbar.tsx:34

Optional hotkey binding (e.g. "ctrl+s").


hotkeyAllowDefault?

optional hotkeyAllowDefault: boolean

Defined in: src/ui/widgets/toolbar.tsx:36

Whether the browser's default hotkey behavior should be allowed.


hotkeyContext?

optional hotkeyContext: any

Defined in: src/ui/widgets/toolbar.tsx:38

Optional context element to which the hotkey is bound.


icon?

optional icon: IconClassName

Defined in: src/ui/widgets/toolbar.tsx:17

Optional icon class name to display before the title.

Inherited from

ToolButtonProps.icon


onClick()?

optional onClick: (e) => void

Defined in: src/ui/widgets/toolbar.tsx:19

Handler invoked when the button is clicked.

Parameters

e

MouseEvent & object

Returns

void

Inherited from

ToolButtonProps.onClick


ref()?

optional ref: (el) => void

Defined in: src/ui/widgets/toolbar.tsx:21

Callback invoked with the created button element.

Parameters

el

HTMLElement

Returns

void

Inherited from

ToolButtonProps.ref


separator?

optional separator: boolean | "left" | "right" | "both"

Defined in: src/ui/widgets/toolbar.tsx:40

Whether (and where) a separator should be rendered before the button.


title?

optional title: string | HTMLElement | DocumentFragment | SVGElement | MathMLElement

Defined in: src/ui/widgets/toolbar.tsx:11

The button's title (text or element).

Inherited from

ToolButtonProps.title


visible?

optional visible: boolean | () => boolean

Defined in: src/ui/widgets/toolbar.tsx:23

Whether the button is visible; may be a function evaluated on update.

Inherited from

ToolButtonProps.visible