Sha256: b7c42f4b1d711b85453f904986cbce1ff0a69351a1db8217185cbaac9ef3c437

Contents?: true

Size: 1.11 KB

Versions: 39

Compression:

Stored size: 1.11 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" href="#{{ id }}">
          {{ 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" id="{{ id }}">
    {{ item.panel.html | safe if item.panel.html else item.panel.text }}
  </section>
  {% endfor %}
</div>

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
govuk_publishing_components-11.0.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-10.2.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-10.1.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-10.0.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.28.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.27.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.26.1 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.26.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.25.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.24.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.23.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.22.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.21.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.20.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.19.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.18.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.17.1 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.17 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.16.1 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.16.0 node_modules/govuk-frontend/components/tabs/template.njk