@serenity-is/corelib / ToolButton
Interface: ToolButton
Defined in: src/ui/widgets/toolbar.tsx:33
A toolbar button definition, extending ToolButtonProps with hotkey and separator support.
Extends
Properties
action?
optionalaction:string
Defined in: src/ui/widgets/toolbar.tsx:10
Optional action name stored on the button's data-action attribute.
Inherited from
cssClass?
optionalcssClass:string
Defined in: src/ui/widgets/toolbar.tsx:16
Optional CSS class(es) applied to the button.
Inherited from
disabled?
optionaldisabled:boolean| () =>boolean
Defined in: src/ui/widgets/toolbar.tsx:26
Whether the button is disabled; may be a function evaluated on update.
Inherited from
hint?
optionalhint:string
Defined in: src/ui/widgets/toolbar.tsx:14
Optional tooltip hint shown on hover.
Inherited from
hotkey?
optionalhotkey:string
Defined in: src/ui/widgets/toolbar.tsx:35
Optional hotkey binding (e.g. "ctrl+s").
hotkeyAllowDefault?
optionalhotkeyAllowDefault:boolean
Defined in: src/ui/widgets/toolbar.tsx:37
Whether the browser's default hotkey behavior should be allowed.
hotkeyContext?
optionalhotkeyContext:any
Defined in: src/ui/widgets/toolbar.tsx:39
Optional context element to which the hotkey is bound.
icon?
optionalicon:IconClassName
Defined in: src/ui/widgets/toolbar.tsx:18
Optional icon class name to display before the title.
Inherited from
onClick()?
optionalonClick: (e) =>void
Defined in: src/ui/widgets/toolbar.tsx:20
Handler invoked when the button is clicked.
Parameters
e
MouseEvent & object
Returns
void
Inherited from
ref()?
optionalref: (el) =>void
Defined in: src/ui/widgets/toolbar.tsx:22
Callback invoked with the created button element.
Parameters
el
HTMLElement
Returns
void
Inherited from
separator?
optionalseparator:boolean|"left"|"right"|"both"
Defined in: src/ui/widgets/toolbar.tsx:41
Whether (and where) a separator should be rendered before the button.
title?
optionaltitle:string|HTMLElement|DocumentFragment|SVGElement|MathMLElement
Defined in: src/ui/widgets/toolbar.tsx:12
The button's title (text or element).
Inherited from
visible?
optionalvisible:boolean| () =>boolean
Defined in: src/ui/widgets/toolbar.tsx:24
Whether the button is visible; may be a function evaluated on update.