Sha256: 1499447aa0b3f280508cbf9219e2517fbe0e2f6b77b6950aebe80a77f44ed072

Contents?: true

Size: 1.43 KB

Versions: 306

Compression:

Stored size: 1.43 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="govuk-accordion" id="{{ id }}"
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
  {% for item in params.items %}
    {% if item %}
      <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>
    {% endif %}
  {% endfor %}
</div>

Version data entries

306 entries across 306 versions & 2 rubygems

Version Path
defra_ruby_template-3.15.1 node_modules/govuk-frontend/govuk/components/accordion/template.njk
defra_ruby_template-3.15.0 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-30.4.1 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-30.4.0 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-30.3.0 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-30.2.1 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-30.2.0 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-30.1.0 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-30.0.0 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-29.15.3 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-29.15.2 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-29.15.1 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-29.15.0 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-29.14.0 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-29.13.0 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-29.12.1 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-29.12.0 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-29.11.0 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-29.10.0 node_modules/govuk-frontend/govuk/components/accordion/template.njk
govuk_publishing_components-29.9.0 node_modules/govuk-frontend/govuk/components/accordion/template.njk