{% if tabs | length > 0 %}
    {# if nested `row` should have no border and the grid divs should be 3-9 #}
    {% if nested %}
        {% set c1 = 3 %}
        {% set c2 = 9 %}
        {% set border = ' style="border: 0px;"' %}
    {% else %}
        {% set c1 = 2 %}
        {% set c2 = 10 %}
        {% set border = '' %}
    {% endif %}
    <div class="row {% if classes %}{{ classes }}{% else %}variable{% endif %}"{% if id %} id="{{ id }}"{% endif %}{{ border }}>
        <div class="col-sm-{{ c1 }}">
            <select class="form-control multiple"
                    role="tablist"
                    id="select-{{ id }}"
                    multiple>
                {% for tab in tabs %}
                    <option role="presentation"
                            {% if loop.first %} class="active"{% endif %}
                            data-target="#{{ anchor_id }}-{{ tab.anchor_id }}"
                            aria-controls="{{ anchor_id }}-{{ tab.anchor_id }}"
                            role="tab"
                            data-toggle="tab">
                        {{ tab.name | fmt_badge }}
                    </option>
                {% endfor %}
            </select>
        </div>
        <div class="tab-content col-sm-{{ c2 }}">
            {% for tab in tabs %}
                <div role="tabpanel"
                     class="tab-pane col-sm-12{% if loop.first %} active{% endif %}"
                     id="{{ anchor_id }}-{{ tab.anchor_id }}">
                    {{ tab.render() }}
                </div>
            {% endfor %}
        </div>
    </div>
{% endif %}
