Switch Button

An interactive UI element that represents a particular boolean function.

Twig Usage
{% include '@bolt-components-switch-button/switch-button.twig' with {
  label: 'This is the label for the switch button'
} only %}
Schema
Prop Name Description Type Default Value Option(s)
attributes

A Drupal attributes object. Applies extra HTML attributes to this component's parent container.

object
button_attributes

A Drupal attributes object. Applies extra HTML attributes to this component's <button> element.

object
label *

Render a label in front of the switch button.

any
on

Controls the active state of the switch button. Sets button state to "on" by default.

boolean false
Install Install
npm install @bolt/components-switch-button
Dependencies @bolt/core