Skip to main content

Toggle Button

<sl-toggle-button> | SlToggleButton
Since 1.1.8 experimental

Toggle button allows the user to select a single option from a group.

Slots

Name Description
(default) The default slot.
prefix A prefix slot.
suffix A suffix slot.

Learn more about using slots.

Properties

Name Description Reflects Type Default
disabled Disables the toggle button. boolean false
checked Whether the toggle button is in an active state. boolean false
updateComplete A read-only promise that resolves when the component has finished updating.

Learn more about attributes and properties.

Events

Name React Event Description Event Detail
sl-blur Emitted when the toggle button loses focus. -
sl-focus Emitted when the toggle button gains focus. -

Learn more about events.

Parts

Name Description
base The component’s base wrapper.
content The toggle button’s content.
prefix The container that wraps the prefix.
suffix The container that wraps the suffix.

Learn more about customizing CSS parts.