uikit-accordion.html.twig in UIkit Components 8.3
Default theme implementation for a UIkit Accordion.
Available variables:
- attributes: HTML attributes to be applied to the accordion.
- items: An associative array containing the title and content for each accordion item.
File
templates/components/uikit-accordion.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation for a UIkit Accordion.
- *
- * Available variables:
- * - attributes: HTML attributes to be applied to the accordion.
- * - items: An associative array containing the title and content for each
- * accordion item.
- *
- * @see \Drupal\uikit_components\Element\UIkitAccordion
- * @see template_preprocess_uikit_accordion()
- * @see https://getuikit.com/docs/accordion
- *
- * @ingroup uikit_components_theme_render
- */
- #}
- {% if items %}
- <ul{{ attributes }}>
- {% for item in items %}
- <li>
- <h3 class="uk-accordion-title">{{ item.title }}</h3>
- <div class="uk-accordion-content">{{ item.content }}</div>
- </li>
- {% endfor %}
- </ul>
- {% endif %}