CSS
  .CheckboxSwitch {
    width: 32px;
    height: 18px;
    background: #141416;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
  }
  .CheckboxSwitch::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #55556a;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s, background 0.2s;
  }
  .CheckboxSwitch:checked { background: #8b7cf8; border-color: #8b7cf8; }
  .CheckboxSwitch:checked::after { transform: translateX(14px); background: #fff; }
HTML
<input type="checkbox" class="CheckboxSwitch">