Toggle
Example Usage
<div class="toggle-test"></div>
// Pull in the library
const UI = require('jibe-juice');
// Instantiate a component, pass the selector of the container to insert component into and the opts
const toggleTest = new Toggle('.toggle-test', {
toggledClass: 'toggled-class',
untoggledClass: 'untoggled-class'
});
// Render the DOM for the Toggle component
toggleTest.render();
params
| Name | Type | Default | Description |
|---|---|---|---|
| el | string | undefined | A string of the selector for the element to put the component in |
| opts | object | {} | A catch all for various options. See the opts table below for options specific to this component. |
opts
| Name | Type | Default | Description |
|---|---|---|---|
| toggledClass | string | undefined | The class to apply when toggled is true |
| untoggledClass | string | undefined | The class to apply when toggled is false |
Updated less than a minute ago
Did this page help you?
