- Selector
- bp-toggle
Inputs
Input | Type | Description | Notes |
---|---|---|---|
toggleGroupName | string | The 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. |
toggles | Toggle[] | An array of objects that define the toggles in the toggle group. | Required. |
Toggle
Property | Type | Description | Notes |
---|---|---|---|
text | string | The text used in the toggle. | Required. |
bpID | string | The value for the toggle's id attribute. | Ids must only be used once per page. Ids should be camelCase, e.g.: #myId. See identifiers. |
value | string | The 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. |
isDisabled | boolean | Determines 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
Output | Description |
---|---|
valueChange | Emits 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
ID | Description |
---|---|
bpID + 'Toggle' + i | The unique identifier for each toggle in a group of toggles. |