You are here

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.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for a UIkit Accordion.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes to be applied to the accordion.
  8. * - items: An associative array containing the title and content for each
  9. * accordion item.
  10. *
  11. * @see \Drupal\uikit_components\Element\UIkitAccordion
  12. * @see template_preprocess_uikit_accordion()
  13. * @see https://getuikit.com/docs/accordion
  14. *
  15. * @ingroup uikit_components_theme_render
  16. */
  17. #}
  18. {% if items %}
  19. <ul{{ attributes }}>
  20. {% for item in items %}
  21. <li>
  22. <h3 class="uk-accordion-title">{{ item.title }}</h3>
  23. <div class="uk-accordion-content">{{ item.content }}</div>
  24. </li>
  25. {% endfor %}
  26. </ul>
  27. {% endif %}

Related topics