code: function createToggle(options, fn) {
          var name = options.name || '';
          var labelOn = options.labelOn || 'on';
          var labelOff = options.labelOff || 'off';
          var value = !!options.value;
  
          var el = document.createElement('div');
          el.innerHTML = '\n        <div class="Control" data-toggle>\n          <h3 class="Control-name" data-name>' + name + '</h3>\n          <div class="Control-inner">\n            <div class="Control-circle">\n              <div class="Control-mark Control-mark--cross" data-icon></div>\n            </div>\n          </div>\n          <output class="Control-output" data-output></output>\n        </div>\n        ';
          options.el.appendChild(el);
          var iconEl = el.querySelector('[data-icon]');
          var outputEl = el.querySelector('[data-output]');
  
          function updateState(val) {
              if (val) {
                  iconEl.classList.remove('Control-mark--cross');
                  iconEl.classList.add('Control-mark--tick');
              } else {
                  iconEl.classList.remove('Control-mark--tick');
                  iconEl.classList.add('Control-mark--cross');
              }
              setLabel(val ? labelOn : labelOff);
          }
  
          function onDown(event) {
              if (event.type === 'touchstart') {
                  el.removeEventListener('mousedown', onDown);
              }
  
              value = !value;
  
              updateState(value);
  
              if (fn) {
                  fn(value);
              }
          }
  
          function setLabel(v) {
              outputEl.value = v;
          }
  
          function toggle(val) {
              value = val;
              updateState(val);
          }
  
          function destroy() {
              el.removeEventListener('mousedown', onDown);
              el.removeEventListener('touchstart', onDown);
          }
  
          el.addEventListener('mousedown', onDown);
          el.addEventListener('touchstart', onDown);
          updateState(value);
  
          return { setLabel: setLabel, toggle: toggle, destroy: destroy };
      }
docs: /*
  Toggle control