Toggle
A custom toggle switch element.
Example
const toggleHandler = (checked) => console.log('toggle', checked ? 'on' : 'off');
<gb-toggle on-toggle="{ toggleHandler }"></gb-toggle>
Properties
Property | Type | Default | Description |
---|---|---|---|
checked |
boolean | false |
true if the toggle is in the “on” position, false otherwise. |
onToggle |
function | The function to call when toggle is switched. checked: boolean - the current state of the toggle |
State
This component does not have any properties in state.
Events
This component does not listen for any events.