{% extends default ? "partials/field.html.twig" : 'forms/' ~ layout|default('field') ~ '.html.twig' %}

{% block input %}
    <span class="enabler" role="checkbox" aria-checked="{{ value ? 'true' : 'false' }}" tabindex="0" aria-label="{{ disabled ? 'Disabled' : 'Enables ' ~ scope|replace({'.': ' '})|title|trim|default(title|trim) }}">
    <input
            {# required attribute structures #}
            type="hidden"
            name="{{ (scope ~ name)|fieldName|e }}"
            value="{{ value ? 1 : 0 }}"
            {% if disabled %}disabled="disabled"{% endif %}
            {# global attribute structures #}
            {{ block('global_attributes') }}
            />
    {% if disabled %}
    <span><i class="fa fa-power-off"></i></span>
    {% else %}
    <span class="toggle"><span class="knob"></span></span>
    {% endif %}
</span>
{% endblock %}
