Sha256: f4fc33e133aed4705428f86b5de9a213bdabbd540b0678a9a3d61d230e571587

Contents?: true

Size: 1.36 KB

Versions: 72

Compression:

Stored size: 1.36 KB

Contents

{% set id = params.id %}
{% set headingLevel = params.headingLevel if params.headingLevel else 2 %}

<div class="govuk-accordion {%- if params.classes %} {{ params.classes }}{% endif -%}"  data-module="accordion" id="{{ id }}"
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>

  {% for item in params.items %}
    <div class="govuk-accordion__section {% if item.expanded %}govuk-accordion__section--expanded{% endif %}">
      <div class="govuk-accordion__section-header">
        <h{{ headingLevel }} class="govuk-accordion__section-heading">
          <span class="govuk-accordion__section-button" id="{{ id }}-heading-{{ loop.index }}">
            {{ item.heading.html | safe if item.heading.html else item.heading.text }}
          </span>
        </h{{ headingLevel }}>
        {% if item.summary.html or item.summary.text %}
          <div class="govuk-accordion__section-summary govuk-body" id="{{ id }}-summary-{{ loop.index }}">
            {{ item.summary.html | safe if item.summary.html else item.summary.text }}
          </div>
        {% endif %}
      </div>
      <div id="{{ id }}-content-{{ loop.index }}" class="govuk-accordion__section-content" aria-labelledby="{{ id }}-heading-{{ loop.index }}">
        {{ item.content.html | safe if item.content.html else item.content.text }}
      </div>
    </div>
  {% endfor %}

</div>

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
govuk_publishing_components-17.21.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.20.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.19.1 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.19.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.18.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.17.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.16.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.15.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.14.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.13.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.12.2 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.12.1 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.12.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.11.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.10.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.9.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.8.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.7.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.6.1 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.6.0 node_modules/govuk-frontend/components/accordion/template.njk