{%- set on = (on is defined ? on : false) %}
{%- set value = (value is defined ? value : '1') %}
{%- set small = (small is defined ? small : false) %}
{%- set toggle = (toggle is defined ? toggle : false) %}
{%- set reverseToggle = (reverseToggle is defined ? reverseToggle : false) %}
{%- set disabled = (disabled is defined ? disabled : false) %}

<div class="lightswitch{% if on %} on{% endif %}{% if small %} small{% endif %}{% if toggle or reverseToggle %} fieldtoggle{% endif %}{% if disabled %} disabled{% endif %}" tabindex="0" data-value="{{ value }}"
    {%- if id is defined %} id="{{ id }}"{% endif %}
    {%- if labelId is defined %} aria-labelledby="{{ labelId }}"{% endif %}
    {%- if toggle %} data-target="{{ toggle }}"{% endif %}
    {%- if reverseToggle %} data-reverse-target="{{ reverseToggle }}"{% endif %}
    {%- if block('attr') is defined %} {{ block('attr') }}{% endif %}>
    <div class="lightswitch-container">
        <div class="label on"></div>
        <div class="handle"></div>
        <div class="label off"></div>
    </div>
    {% if name is defined -%}
        <input type="hidden" name="{{ name }}" value="{{ on ? value }}"{% if disabled %} disabled{% endif %}>
    {%- endif %}
</div>
