{% set attributes = id ? attributes.setAttribute('id', id) : attributes %}
{% if variant and variant != 'default' %}
  {% set attributes = attributes.setAttribute('placement', variant|default('start')) %}
{% else %}
  {% set attributes = attributes.setAttribute('placement', 'start') %}
{% endif %}

{% set attributes = no_header ? attributes.setAttribute('no-header', no_header) : attributes %}
{# https://shoelace.style/components/drawer#scrolling #}
{% set attributes = attributes.addClass(['shoelace-drawer', 'drawer-scrolling']) %}

{# https://shoelace.style/components/drawer#contained-to-an-element #}
{% if contained %}
  {% set attributes = attributes.addClass('drawer-contained') %}
  {% set attributes = attributes.setAttribute('contained', true) %}
{% endif %}

<sl-drawer{{ attributes }} label="{{ label }}" style="--size: {{ size|default('25rem') }};" >
  {{ content }}
  {% if footer_close %}
    <sl-button slot="footer" variant="{{ close_variant|default('primary') }}" data-drawer-target="{{ id }}">{{ 'Close'|t }}</sl-button>
  {% endif %}
</sl-drawer>
