Toggle
Documentation
Input Parameters
Name | Type | Description |
---|---|---|
className | string | The class name to apply to the main element. |
el | HTMLElement | The element to render the toggle to. |
description | string | The toggle description. |
onChange | (value: boolean) | The change event. |
value | boolean | The toggle value. |
Interface
Name | Type/Description |
---|---|
get() | Returns the toggle element. |
getFabricComponent() | Returns the fabric component. |
getValue() | Returns the toggle value. |
Fabric Interface
Name | Type/Description |
---|---|
_container | HTMLDivElement |
JavaScript
var $REST = require("gd-sprest-js");
// Create the toggle
var el = document.querySelector("#toggle");
$REST.JS.Fabric.Toggle({ el: el });
TypeScript
import { Fabric } from "gd-sprest-js";
// Create the toggle
let el = document.querySelector("#toggle");
Fabric.Toggle({ el });