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.5.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.4.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.3.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.2.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.1.1 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.1.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-17.0.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-16.29.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-16.28.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-16.27.1 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-16.27.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-16.26.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-16.25.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-16.24.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-16.23.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-16.22.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-16.21.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-16.20.1 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-16.20.0 node_modules/govuk-frontend/components/accordion/template.njk
govuk_publishing_components-16.19.0 node_modules/govuk-frontend/components/accordion/template.njk