Skip to content

@serenity-is/corelib / ToolButtonProps

Interface: ToolButtonProps

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

Props describing a single toolbar button.

Extended by

Properties

action?

optional action: string

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

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


cssClass?

optional cssClass: string

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

Optional CSS class(es) applied to the button.


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.


hint?

optional hint: string

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

Optional tooltip hint shown on hover.


icon?

optional icon: IconClassName

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

Optional icon class name to display before the title.


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


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


title?

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

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

The button's title (text or element).


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.