menu_close_action_button¶
The menu_close_action_button
macro is used to render a button allowing to close a menu. It renders a webcomponent that requires the usage of this macro within a menu context.
Definition¶
Input parameters¶
options¶
options
parameter represents an object of close action button attributes
Option key | Type | Default | Required | Description |
---|---|---|---|---|
options.classList | string |
"" | no | A list of css classes that will be added to the close action button. |
Example¶
In this example we render a close menu action button with additional classes.
{% from "@macros/menu_close_action_button.twig" import menu_close_action_button %}
{{ menu_close_action_button({
classList: 'btn_s btn_full-width'
}) }}
Macro source code¶
{% macro menu_close_action_button(options) %}
{% from "@macros/icon.twig" import icon %}
<s-menu-action-button
action="close"
class="menu-action-button menu-action-button_close {% if options.classList %}{{ options.classList|join(' ') }}{% endif %}">
{{ icon('icon-x', {
classNames: ['menu-action-button__icon']
}) }}
</s-menu-action-button>
{% endmacro %}