The toggle button wraps a native button element and exposes additional value and selected properties. Use it in a button group to make a toolbar or a set of options.

Element
igc-toggle-button
Slots
default — Renders the label/content of the button.
CSS Parts
toggle — The native button element.
focused — Added to the toggle part when the button has keyboard focus.

Whether the button is disabled.

disabled: boolean = false

Defined in src/components/button-group/toggle-button.ts:82

Whether the button is selected.

selected: boolean = false

Defined in src/components/button-group/toggle-button.ts:73

The value of the control.

value: string

Defined in src/components/button-group/toggle-button.ts:64

The tagName read-only property of the Element interface returns the tag name of the element on which it's called.

MDN Reference

tagName: "igc-toggle-button" = 'igc-toggle-button'

Defined in src/components/button-group/toggle-button.ts:44

Removes focus from the button.

blur(): void

Defined in src/components/button-group/toggle-button.ts:137

Returns void

Simulates a mouse click on the element.

click(): void

Defined in src/components/button-group/toggle-button.ts:143

Returns void

Invoked when the component is removed from the document's DOM.

This callback is the main signal to the element that it may no longer be used. disconnectedCallback() should ensure that nothing is holding a reference to the element (such as event listeners added to nodes external to the element), so that it is free to be garbage collected.

``

An element may be re-connected after being disconnected.

disconnectedCallback(): void

Defined in src/components/button-group/toggle-button.ts:89

Returns void

Sets focus on the button.

focus(options: FocusOptions): void

Defined in src/components/button-group/toggle-button.ts:130

Parameters

  • options: FocusOptions

Returns void