Skip to main content

toggleButton()

toggleButton(caption, handler?, tooltip?): HTMLDivElement

Defined in: ui.ts:504

Creates a toggle button (d4-toggle-button). When clicked, marks itself as current (d4-current) and clears that class from sibling toggle buttons under the same parent. Wrap a set of these in toggleButtonGroup to get the group container styling.

Parameters

ParameterTypeDefault valueDescription
captionstringundefinedButton text.
handlerFunction | nullnullInvoked on click after the active state is updated.
tooltipstring | nullnullTooltip shown on hover.

Returns

HTMLDivElement