Selector
bp-toggle

Inputs

Toggle inputs
InputTypeDescriptionNotes
toggleGroupNamestringThe value of the toggle group's name attribute.

Required.

When a form is submitted, the name attribute's value is the reported name of the toggle if the toggle is checked and enabled.

togglesToggle[]An array of objects that define the toggles in the toggle group.Required.

Toggle

Toggle properties
PropertyTypeDescriptionNotes
textstringThe text used in the toggle.Required.
bpIDstringThe value for the toggle's id attribute.

Ids must only be used once per page.

Ids should be camelCase, e.g.: #myId.

See identifiers.

valuestringThe value for the toggle's value attribute.

The value attributes' values should be unique for each toggle.

When a form is submitted, the value attribute's value is the reported value of the toggle if the toggle is checked and enabled.

isDisabledbooleanDetermines if the toggle is disabled or enabled.

Default is "false".

When "true" the toggle is disabled.

When a form is submitted, a toggle's value is only included in the submitted data if the toggle is checked and enabled.

Outputs

Toggle outputs
OutputDescription
valueChangeEmits an event on change of the checked toggle.
checkedToggle

A two-way data binding used to read/write the id of the currently checked toggle.

On page load, there must be a toggle that is checked. The default selection is the first toggle in the toggle group.

When a form is submitted, a toggle's value is only included in the submitted data if the toggle is checked and enabled.

Identifiers

Identifiers
IDDescription
bpID + 'Toggle' + iThe unique identifier for each toggle in a group of toggles.