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-9.15.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.14.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.13.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.12.2 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.12.1 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.12.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.11.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.10.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.9.1 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.9.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.8.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.7.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.6.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.5.3 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.5.2 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.5.1 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.5.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_publishing_components-9.4.0 node_modules/govuk-frontend/components/tabs/template.njk
govuk_fe_assets-0.1.0.pre.alpha node_modules/govuk-frontend/components/tabs/template.njk