{% with id=widget.attrs.id %}
<div{% if id %} id="{{ id }}"{% endif %} class="d-flex flex-row">
  {% for group, options, index in widget.optgroups %}
    {% for option in options %}
      {% include option.template_name with widget=option %}
    {% endfor %}
  {% endfor %}
</div>
{% endwith %}
