{% with id=widget.attrs.id %}
    <div{% if id %} id="{{ id }}"{% endif %} class="btn-group btn-group-toggle" data-bs-toggle="buttons">
        {% for group, options, index in widget.optgroups %}
            {% for option in options %}
                {% if option.value != '' %}
                {% include option.template_name with widget=option %}
                {% endif %}
            {% endfor %}
        {% endfor %}
    </div>{% endwith %}
