j-ToggleButton
Configuration:
required{Boolean} optional, enables "required" (default:false)disabled{Boolean} optional, disables this componenticontrue{String} optional, toggles FontAwesome icons if the value istrueiconfalse{String} optional, toggles FontAwesome icons if the value isfalse
Icons can be in the form: circle or ti ti-circle.
Use it with <ui-component name="togglebutton">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.
<div class="container">
<div class="row">
<div class="col-md-4">
<ui-component name="togglebutton" path="form.darkmode" config="icontrue:lightbulb"></ui-component>
</div>
</div>
</div>
<script>
var form = {};
form.darkmode = false;
WATCH('form.darkmode', function(path, value) {
$('body').tclass('ui-dark', value === true);
});
</script>