Sha256: 6df289f20b3f0d1f9288bf5635ce170f72d5cd0768188f304b31879534d1a3d8

Contents?: true

Size: 1.41 KB

Versions: 112

Compression:

Stored size: 1.41 KB

Contents

{#- If an id 'prefix' is not passed, fall back to using the name attribute
   instead. We need this for error messages and hints as well -#}
{% set idPrefix = params.idPrefix if params.idPrefix %}

<div {%- if params.id %} id="{{params.id}}"{% endif %} class="govuk-tabs {%- if params.classes %} {{ params.classes }}{% endif %}" {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %} data-module="tabs">
  <h2 class="govuk-tabs__title">
    {{ params.title | default ("Contents") }}
  </h2>

  {% if(params.items) %}
  <ul class="govuk-tabs__list">
    {% for item in params.items %}
    {% set id = item.id if item.id else idPrefix + "-" + loop.index %}
      <li class="govuk-tabs__list-item">
        <a class="govuk-tabs__tab{% if loop.index == 1 %} govuk-tabs__tab--selected{% endif %}" href="#{{ id }}"
           {%- for attribute, value in item.attributes %} {{attribute}}="{{value}}"{% endfor %}>
          {{ item.label }}
        </a>
      </li>
    {% endfor %}
  </ul>
  {% endif %}

  {% for item in params.items %}
  {% set id = item.id if item.id else idPrefix + "-" + loop.index %}
  <section class="govuk-tabs__panel{% if loop.index > 1 %} govuk-tabs__panel--hidden{% endif %}" id="{{ id }}"{% for attribute, value in item.panel.attributes %} {{attribute}}="{{value}}"{% endfor %}>
    {{ item.panel.html | safe if item.panel.html else item.panel.text }}
  </section>
  {% endfor %}
</div>

Version data entries

112 entries across 112 versions & 1 rubygems

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