display_builder-1.0.x-dev/components/shoelace/drawer/drawer.twig
components/shoelace/drawer/drawer.twig
{% set attributes = id ? attributes.setAttribute('id', id) : attributes %}
{% set attributes = no_header ? attributes.setAttribute('no-header', no_header) : attributes %}
{# https://shoelace.style/components/drawer#scrolling #}
{% set attributes = attributes.addClass(['db-background', 'db-drawer', 'drawer-scrolling']) %}
{% if placement %}
{% set attributes = attributes.setAttribute('placement', placement|default('end')) %}
{% endif %}
{# 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>
