<span class="btn-group btn-group-toggle quick-filters {{ widget.attrs.class }}" data-toggle="buttons">
  {% for group, options, index in widget.optgroups %}
    <label class="btn btn-outline-secondary {% if options.0.selected %}active{% endif %}">
      <input type="{% if widget.attrs.select_multiple %}checkbox{% else %}radio{% endif %}" {% if widget.attrs.submit %}onchange="this.form.submit()"{% endif %}
             {% if options.0.selected %}checked{% endif %}
             name="{{ options.0.name }}"
             value="{{ options.0.value }}"
      > {{ options.0.label }}
    </label>
  {% endfor %}
</span>