dsfr4drupal-1.x-dev/components/button-group/button-group.twig
components/button-group/button-group.twig
{% set attributes = attributes|default(create_attribute()) %}
{% if variant and variant != 'md' %}
{% set attributes = attributes.addClass('fr-btns-group--' ~ variant) %}
{% endif %}
{% if inline %}
{% if inline_from %}
{% set attributes = attributes.addClass('fr-btns-group--inline-' ~ inline_from) %}
{% else %}
{% set attributes = attributes.addClass('fr-btns-group--inline') %}
{% endif %}
{% endif %}
{% if position and position != 'left' %}
{% set attributes = attributes.addClass('fr-btns-group--' ~ position) %}
{% endif %}
{% if equisized %}
{% set attributes = attributes.addClass('fr-btns-group--equisized') %}
{% endif %}
{% if items|length > 1 %}
<ul{{ attributes.addClass('fr-btns-group') }}>
{% for item in items %}
<li>
{{ include('dsfr4drupal:button', item, with_context=false) }}
</li>
{% endfor %}
</ul>
{% else %}
<div{{ attributes.addClass('fr-btns-group') }}>
{% for item in items %}
{{ include('dsfr4drupal:button', item, with_context=false) }}
{% endfor %}
</div>
{% endif %}
