Tabs examples

Show params

Params

params:
- name: id
  type: string
  required: false
  description: This is used for the main component and to compose id attribute for each item.
- name: idPrefix
  type: string
  required: false
  description: String to prefix id for each tab item if no id is specified on each item
- name: title
  type: string
  required: true
  description: Title for the tabs table of contents
- name: headingLevel
  type: number
  required: false
  description: If headingLevel is 1, the parent heading tag needed inside this component will be a h1, if 2 will be a h2, and so on.
- name: tablistAriaLabel
  type: string
  required: true
  description: aria-label for the role=tablist element
- name: items
  type: array
  required: true
  description: Array of tab items.
  params:
  - name: id
    type: string
    required: true
    description: Specific id attribute for the tab item. If omitted, then `idPrefix` string is required instead.
  - name: text
    type: string
    required: true
    description: If `html` is set, this is not required. Text to use within each tab label. If `html` is provided, the `text` argument will be ignored.
  - name: html
    type: string
    required: true
    description: If `text` is set, this is not required. HTML to use within the each tab label. If `html` is provided, the `text` argument will be ignored.
  - name: disabled
    type: boolean
    required: false
    description: If true, nav item will be disabled.
  - name: attributes
    type: object
    required: false
    description: HTML attributes (for example data attributes) to add to the tab.
  - name: panel
    description: Content for the panel
    type: object
    required: true
    params:
      - name: text
        type: string
        required: true
        description: If `html` is set, this is not required. Text to use within each tab panel. If `html` is provided, the `text` argument will be ignored.
      - name: html
        type: string
        required: true
        description: If `text` is set, this is not required. HTML to use within the each tab panel. If `html` is provided, the `text` argument will be ignored.
      - name: classes
        type: string
        required: false
        description: Classes to add to the tab panel.
      - name: attributes
        type: object
        required: false
        description: HTML attributes (for example data attributes) to add to the tab panel.
- name: classes
  type: string
  required: false
  description: Classes to add to the tabs component.
- name: attributes
  type: object
  required: false
  description: HTML attributes (for example data attributes) to add to the tabs component.

default

Contenido

Tab 1

Panel 1. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?

Show code

Macro

{% from "components/tabs/_macro.tabs.njk" import componentTabs %}
{{ componentTabs({
  "tablistAriaLabel": "Tab example",
  "idPrefix": "tab-example",
  "items": [
    {
      "text": "Tab 1",
      "panel": {
        "html": "<p><strong>Panel 1</strong>. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?</p>"
      }
    },
    {
      "text": "Tab 2",
      "panel": {
        "html": "<p><strong>Panel 2</strong>. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    },
    {
      "text": "Tab 3",
      "panel": {
        "html": "<p><strong>Panel 3</strong>. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    },
    {
      "text": "Tab 4",
      "panel": {
        "html": "<p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    }
  ]
})  }}

Markup

<!-- tabs -->
<div class="c-tabs" data-module="c-tabs">
    <h2 class="lg:hidden mb-sm text-sm">Contenido</h2>
  <div class="c-tabs lg:flex lg:flex-wrap" role="tablist" aria-label="Tab example">
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="true" aria-controls="tab-tab-example-1" id="tab-example-1">
            <span class="flex items-center pointer-events-none">
              Tab 1
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-2" id="tab-example-2" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 2
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-3" id="tab-example-3" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 3
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-4" id="tab-example-4" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 4
            </span>
          </button>
  </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-1" tabindex="0" role="tabpanel" aria-labelledby="tab-example-1">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 1</h3>
            <p><strong>Panel 1</strong>. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-2" tabindex="0" role="tabpanel" aria-labelledby="tab-example-2" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 2</h3>
            <p><strong>Panel 2</strong>. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-3" tabindex="0" role="tabpanel" aria-labelledby="tab-example-3" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 3</h3>
            <p><strong>Panel 3</strong>. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-4" tabindex="0" role="tabpanel" aria-labelledby="tab-example-4" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 4</h3>
            <p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
</div>
<!-- /tabs -->

with headingLevel 3

Título con h3

Tab 1 con h4

Panel 1. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?

Show code

Macro

{% from "components/tabs/_macro.tabs.njk" import componentTabs %}
{{ componentTabs({
  "title": "Título con h3",
  "headingLevel": 3,
  "tablistAriaLabel": "headingLevel example",
  "idPrefix": "headinglevel-example",
  "items": [
    {
      "text": "Tab 1 con h4",
      "panel": {
        "html": "<p><strong>Panel 1</strong>. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?</p>"
      }
    },
    {
      "text": "Tab 2 con h4",
      "panel": {
        "html": "<p><strong>Panel 2</strong>. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    },
    {
      "text": "Tab 3 con h4",
      "panel": {
        "html": "<p><strong>Panel 3</strong>. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    },
    {
      "text": "Tab 4 con h4",
      "panel": {
        "html": "<p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    }
  ]
})  }}

Markup

<!-- tabs -->
<div class="c-tabs" data-module="c-tabs">
    <h3 class="lg:hidden mb-sm text-sm">Título con h3</h3>
  <div class="c-tabs lg:flex lg:flex-wrap" role="tablist" aria-label="headingLevel example">
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="true" aria-controls="tab-headinglevel-example-1" id="headinglevel-example-1">
            <span class="flex items-center pointer-events-none">
              Tab 1 con h4
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-headinglevel-example-2" id="headinglevel-example-2" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 2 con h4
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-headinglevel-example-3" id="headinglevel-example-3" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 3 con h4
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-headinglevel-example-4" id="headinglevel-example-4" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 4 con h4
            </span>
          </button>
  </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-headinglevel-example-1" tabindex="0" role="tabpanel" aria-labelledby="headinglevel-example-1">
            <h4 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 1 con h4</h4>
            <p><strong>Panel 1</strong>. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-headinglevel-example-2" tabindex="0" role="tabpanel" aria-labelledby="headinglevel-example-2" hidden="">
            <h4 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 2 con h4</h4>
            <p><strong>Panel 2</strong>. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-headinglevel-example-3" tabindex="0" role="tabpanel" aria-labelledby="headinglevel-example-3" hidden="">
            <h4 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 3 con h4</h4>
            <p><strong>Panel 3</strong>. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-headinglevel-example-4" tabindex="0" role="tabpanel" aria-labelledby="headinglevel-example-4" hidden="">
            <h4 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 4 con h4</h4>
            <p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
</div>
<!-- /tabs -->

with html in tabs

Contenido

Tab 1

Panel 1. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?

Show code

Macro

{% from "components/tabs/_macro.tabs.njk" import componentTabs %}
{{ componentTabs({
  "tablistAriaLabel": "Tab example",
  "idPrefix": "tab-example-html",
  "items": [
    {
      "html": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 140 140\" width=\"1em\" height=\"1em\" class=\"w-4 h-4 mr-xs\" aria-label=\"Archivo\" role=\"img\" focusable=\"false\"><path d=\"M89.355 12.518l26.46 26.46a2.917 2.917 0 01.852 2.06v84.379a2.917 2.917 0 01-2.917 2.916h-87.5a2.917 2.917 0 01-2.917-2.916V14.583a2.917 2.917 0 012.917-2.916h61.046a2.917 2.917 0 012.059.851zM90.918 0H23.333a11.667 11.667 0 00-11.666 11.667v116.666A11.667 11.667 0 0023.333 140h93.334a11.667 11.667 0 0011.666-11.667V37.415a5.833 5.833 0 00-1.709-4.124L95.042 1.709A5.833 5.833 0 0090.918 0z\" fill=\"currentColor\"/><path d=\"M93.333 64.167h-52.5a5.833 5.833 0 010-11.667h52.5a5.833 5.833 0 010 11.667zM93.333 87.5h-52.5a5.833 5.833 0 010-11.667h52.5a5.833 5.833 0 010 11.667zM67.083 110.833h-26.25a5.833 5.833 0 010-11.666h26.25a5.833 5.833 0 010 11.666z\" fill=\"currentColor\"/></svg> Tab 1",
      "panel": {
        "html": "<p><strong>Panel 1</strong>. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?</p>"
      }
    },
    {
      "html": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 140 140\" width=\"1em\" height=\"1em\" class=\"w-4 h-4 mr-xs\" aria-label=\"Link\" role=\"img\" focusable=\"false\"><path d=\"M72.368 86.946a5.833 5.833 0 00-3.167 7.624 5.833 5.833 0 01-1.266 6.358l-16.497 16.503a11.667 11.667 0 01-16.496 0l-12.379-12.373a11.667 11.667 0 010-16.502l16.52-16.497a5.91 5.91 0 016.364-1.266 5.834 5.834 0 004.451-10.786 17.698 17.698 0 00-19.063 3.804l-16.52 16.497a23.368 23.368 0 000 32.999l12.378 12.372a23.333 23.333 0 0032.994 0l16.502-16.496a17.547 17.547 0 003.798-19.075 5.833 5.833 0 00-7.619-3.162z\" fill=\"currentColor\"/><path d=\"M45.25 94.74a5.897 5.897 0 008.247 0l45.378-45.373a5.833 5.833 0 00-8.248-8.248L45.249 86.491a5.833 5.833 0 000 8.248z\" fill=\"currentColor\"/><path d=\"M125.685 26.682l-12.373-12.373a23.368 23.368 0 00-32.999 0L63.811 30.806a17.535 17.535 0 00-3.798 19.069A5.835 5.835 0 1070.8 45.418a5.833 5.833 0 011.266-6.335l16.497-16.496a11.667 11.667 0 0116.502 0l12.373 12.372a11.667 11.667 0 010 16.503l-16.52 16.467a5.92 5.92 0 01-6.364 1.266 5.836 5.836 0 00-4.463 10.786 17.652 17.652 0 0019.075-3.798l16.497-16.496a23.374 23.374 0 00.023-33.005z\" fill=\"currentColor\"/></svg> Tab 2",
      "panel": {
        "html": "<p><strong>Panel 2</strong>. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    },
    {
      "html": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 140 140\" width=\"1em\" height=\"1em\" class=\"w-4 h-4 mr-xs\" aria-label=\"Solicitud\" role=\"img\" focusable=\"false\"><path d=\"M96.25 52.5h-52.5a4.375 4.375 0 000 8.75h52.5a4.375 4.375 0 000-8.75zM100.625 77.286a4.375 4.375 0 00-4.375-4.375h-52.5a4.375 4.375 0 000 8.75h52.5a4.375 4.375 0 004.375-4.375zM58.333 37.917h23.334a5.833 5.833 0 005.833-5.834V17.5A17.54 17.54 0 0065.287.624 17.762 17.762 0 0052.5 18.007v14.076a5.833 5.833 0 005.833 5.834zm7.292-21.875A4.375 4.375 0 1170 20.417a4.375 4.375 0 01-4.375-4.381z\" fill=\"currentColor\"/><path d=\"M113.75 17.5H97.708a1.458 1.458 0 00-1.458 1.458v8.75a1.458 1.458 0 001.458 1.459h13.125a2.917 2.917 0 012.917 2.916v74.62a2.917 2.917 0 01-.852 2.065l-18.713 18.708a2.917 2.917 0 01-2.06.851H29.168a2.917 2.917 0 01-2.917-2.916V32.083a2.917 2.917 0 012.917-2.916h13.125a1.458 1.458 0 001.458-1.459v-8.75a1.458 1.458 0 00-1.458-1.458H26.25a11.667 11.667 0 00-11.667 11.667v99.166A11.667 11.667 0 0026.25 140h87.5a11.667 11.667 0 0011.667-11.667V29.167A11.667 11.667 0 00113.75 17.5z\" fill=\"currentColor\"/><path d=\"M43.75 93.333a4.375 4.375 0 000 8.75h21.875a4.375 4.375 0 000-8.75z\" fill=\"currentColor\"/></svg> Tab 3",
      "panel": {
        "html": "<p><strong>Panel 3</strong>. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    },
    {
      "html": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 140 140\" width=\"1em\" height=\"1em\" class=\"w-4 h-4 mr-xs\" aria-label=\"Borrar\" role=\"img\" focusable=\"false\"><g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M100.625 122.5h-61.25a8.75 8.75 0 0 1-8.75-8.75V35h78.75v78.75a8.75 8.75 0 0 1-8.75 8.75zM56.875 96.25v-35M83.125 96.25v-35M13.125 35h113.75M83.125 17.5h-26.25a8.75 8.75 0 0 0-8.75 8.75V35h43.75v-8.75a8.75 8.75 0 0 0-8.75-8.75z\" stroke-width=\"8.749995\"/></g></svg> Tab 4",
      "panel": {
        "html": "<p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    }
  ]
})  }}

Markup

<!-- tabs -->
<div class="c-tabs" data-module="c-tabs">
    <h2 class="lg:hidden mb-sm text-sm">Contenido</h2>
  <div class="c-tabs lg:flex lg:flex-wrap" role="tablist" aria-label="Tab example">
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="true" aria-controls="tab-tab-example-html-1" id="tab-example-html-1">
            <span class="flex items-center pointer-events-none">
              <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="w-4 h-4 mr-xs" aria-label="Archivo" role="img" focusable="false"><path d="M89.355 12.518l26.46 26.46a2.917 2.917 0 01.852 2.06v84.379a2.917 2.917 0 01-2.917 2.916h-87.5a2.917 2.917 0 01-2.917-2.916V14.583a2.917 2.917 0 012.917-2.916h61.046a2.917 2.917 0 012.059.851zM90.918 0H23.333a11.667 11.667 0 00-11.666 11.667v116.666A11.667 11.667 0 0023.333 140h93.334a11.667 11.667 0 0011.666-11.667V37.415a5.833 5.833 0 00-1.709-4.124L95.042 1.709A5.833 5.833 0 0090.918 0z" fill="currentColor"/><path d="M93.333 64.167h-52.5a5.833 5.833 0 010-11.667h52.5a5.833 5.833 0 010 11.667zM93.333 87.5h-52.5a5.833 5.833 0 010-11.667h52.5a5.833 5.833 0 010 11.667zM67.083 110.833h-26.25a5.833 5.833 0 010-11.666h26.25a5.833 5.833 0 010 11.666z" fill="currentColor"/></svg> Tab 1
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-html-2" id="tab-example-html-2" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="w-4 h-4 mr-xs" aria-label="Link" role="img" focusable="false"><path d="M72.368 86.946a5.833 5.833 0 00-3.167 7.624 5.833 5.833 0 01-1.266 6.358l-16.497 16.503a11.667 11.667 0 01-16.496 0l-12.379-12.373a11.667 11.667 0 010-16.502l16.52-16.497a5.91 5.91 0 016.364-1.266 5.834 5.834 0 004.451-10.786 17.698 17.698 0 00-19.063 3.804l-16.52 16.497a23.368 23.368 0 000 32.999l12.378 12.372a23.333 23.333 0 0032.994 0l16.502-16.496a17.547 17.547 0 003.798-19.075 5.833 5.833 0 00-7.619-3.162z" fill="currentColor"/><path d="M45.25 94.74a5.897 5.897 0 008.247 0l45.378-45.373a5.833 5.833 0 00-8.248-8.248L45.249 86.491a5.833 5.833 0 000 8.248z" fill="currentColor"/><path d="M125.685 26.682l-12.373-12.373a23.368 23.368 0 00-32.999 0L63.811 30.806a17.535 17.535 0 00-3.798 19.069A5.835 5.835 0 1070.8 45.418a5.833 5.833 0 011.266-6.335l16.497-16.496a11.667 11.667 0 0116.502 0l12.373 12.372a11.667 11.667 0 010 16.503l-16.52 16.467a5.92 5.92 0 01-6.364 1.266 5.836 5.836 0 00-4.463 10.786 17.652 17.652 0 0019.075-3.798l16.497-16.496a23.374 23.374 0 00.023-33.005z" fill="currentColor"/></svg> Tab 2
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-html-3" id="tab-example-html-3" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="w-4 h-4 mr-xs" aria-label="Solicitud" role="img" focusable="false"><path d="M96.25 52.5h-52.5a4.375 4.375 0 000 8.75h52.5a4.375 4.375 0 000-8.75zM100.625 77.286a4.375 4.375 0 00-4.375-4.375h-52.5a4.375 4.375 0 000 8.75h52.5a4.375 4.375 0 004.375-4.375zM58.333 37.917h23.334a5.833 5.833 0 005.833-5.834V17.5A17.54 17.54 0 0065.287.624 17.762 17.762 0 0052.5 18.007v14.076a5.833 5.833 0 005.833 5.834zm7.292-21.875A4.375 4.375 0 1170 20.417a4.375 4.375 0 01-4.375-4.381z" fill="currentColor"/><path d="M113.75 17.5H97.708a1.458 1.458 0 00-1.458 1.458v8.75a1.458 1.458 0 001.458 1.459h13.125a2.917 2.917 0 012.917 2.916v74.62a2.917 2.917 0 01-.852 2.065l-18.713 18.708a2.917 2.917 0 01-2.06.851H29.168a2.917 2.917 0 01-2.917-2.916V32.083a2.917 2.917 0 012.917-2.916h13.125a1.458 1.458 0 001.458-1.459v-8.75a1.458 1.458 0 00-1.458-1.458H26.25a11.667 11.667 0 00-11.667 11.667v99.166A11.667 11.667 0 0026.25 140h87.5a11.667 11.667 0 0011.667-11.667V29.167A11.667 11.667 0 00113.75 17.5z" fill="currentColor"/><path d="M43.75 93.333a4.375 4.375 0 000 8.75h21.875a4.375 4.375 0 000-8.75z" fill="currentColor"/></svg> Tab 3
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-html-4" id="tab-example-html-4" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="w-4 h-4 mr-xs" aria-label="Borrar" role="img" focusable="false"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="M100.625 122.5h-61.25a8.75 8.75 0 0 1-8.75-8.75V35h78.75v78.75a8.75 8.75 0 0 1-8.75 8.75zM56.875 96.25v-35M83.125 96.25v-35M13.125 35h113.75M83.125 17.5h-26.25a8.75 8.75 0 0 0-8.75 8.75V35h43.75v-8.75a8.75 8.75 0 0 0-8.75-8.75z" stroke-width="8.749995"/></g></svg> Tab 4
            </span>
          </button>
  </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-html-1" tabindex="0" role="tabpanel" aria-labelledby="tab-example-html-1">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="w-4 h-4 mr-xs" aria-label="Archivo" role="img" focusable="false"><path d="M89.355 12.518l26.46 26.46a2.917 2.917 0 01.852 2.06v84.379a2.917 2.917 0 01-2.917 2.916h-87.5a2.917 2.917 0 01-2.917-2.916V14.583a2.917 2.917 0 012.917-2.916h61.046a2.917 2.917 0 012.059.851zM90.918 0H23.333a11.667 11.667 0 00-11.666 11.667v116.666A11.667 11.667 0 0023.333 140h93.334a11.667 11.667 0 0011.666-11.667V37.415a5.833 5.833 0 00-1.709-4.124L95.042 1.709A5.833 5.833 0 0090.918 0z" fill="currentColor"/><path d="M93.333 64.167h-52.5a5.833 5.833 0 010-11.667h52.5a5.833 5.833 0 010 11.667zM93.333 87.5h-52.5a5.833 5.833 0 010-11.667h52.5a5.833 5.833 0 010 11.667zM67.083 110.833h-26.25a5.833 5.833 0 010-11.666h26.25a5.833 5.833 0 010 11.666z" fill="currentColor"/></svg> Tab 1</h3>
            <p><strong>Panel 1</strong>. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-html-2" tabindex="0" role="tabpanel" aria-labelledby="tab-example-html-2" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="w-4 h-4 mr-xs" aria-label="Link" role="img" focusable="false"><path d="M72.368 86.946a5.833 5.833 0 00-3.167 7.624 5.833 5.833 0 01-1.266 6.358l-16.497 16.503a11.667 11.667 0 01-16.496 0l-12.379-12.373a11.667 11.667 0 010-16.502l16.52-16.497a5.91 5.91 0 016.364-1.266 5.834 5.834 0 004.451-10.786 17.698 17.698 0 00-19.063 3.804l-16.52 16.497a23.368 23.368 0 000 32.999l12.378 12.372a23.333 23.333 0 0032.994 0l16.502-16.496a17.547 17.547 0 003.798-19.075 5.833 5.833 0 00-7.619-3.162z" fill="currentColor"/><path d="M45.25 94.74a5.897 5.897 0 008.247 0l45.378-45.373a5.833 5.833 0 00-8.248-8.248L45.249 86.491a5.833 5.833 0 000 8.248z" fill="currentColor"/><path d="M125.685 26.682l-12.373-12.373a23.368 23.368 0 00-32.999 0L63.811 30.806a17.535 17.535 0 00-3.798 19.069A5.835 5.835 0 1070.8 45.418a5.833 5.833 0 011.266-6.335l16.497-16.496a11.667 11.667 0 0116.502 0l12.373 12.372a11.667 11.667 0 010 16.503l-16.52 16.467a5.92 5.92 0 01-6.364 1.266 5.836 5.836 0 00-4.463 10.786 17.652 17.652 0 0019.075-3.798l16.497-16.496a23.374 23.374 0 00.023-33.005z" fill="currentColor"/></svg> Tab 2</h3>
            <p><strong>Panel 2</strong>. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-html-3" tabindex="0" role="tabpanel" aria-labelledby="tab-example-html-3" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="w-4 h-4 mr-xs" aria-label="Solicitud" role="img" focusable="false"><path d="M96.25 52.5h-52.5a4.375 4.375 0 000 8.75h52.5a4.375 4.375 0 000-8.75zM100.625 77.286a4.375 4.375 0 00-4.375-4.375h-52.5a4.375 4.375 0 000 8.75h52.5a4.375 4.375 0 004.375-4.375zM58.333 37.917h23.334a5.833 5.833 0 005.833-5.834V17.5A17.54 17.54 0 0065.287.624 17.762 17.762 0 0052.5 18.007v14.076a5.833 5.833 0 005.833 5.834zm7.292-21.875A4.375 4.375 0 1170 20.417a4.375 4.375 0 01-4.375-4.381z" fill="currentColor"/><path d="M113.75 17.5H97.708a1.458 1.458 0 00-1.458 1.458v8.75a1.458 1.458 0 001.458 1.459h13.125a2.917 2.917 0 012.917 2.916v74.62a2.917 2.917 0 01-.852 2.065l-18.713 18.708a2.917 2.917 0 01-2.06.851H29.168a2.917 2.917 0 01-2.917-2.916V32.083a2.917 2.917 0 012.917-2.916h13.125a1.458 1.458 0 001.458-1.459v-8.75a1.458 1.458 0 00-1.458-1.458H26.25a11.667 11.667 0 00-11.667 11.667v99.166A11.667 11.667 0 0026.25 140h87.5a11.667 11.667 0 0011.667-11.667V29.167A11.667 11.667 0 00113.75 17.5z" fill="currentColor"/><path d="M43.75 93.333a4.375 4.375 0 000 8.75h21.875a4.375 4.375 0 000-8.75z" fill="currentColor"/></svg> Tab 3</h3>
            <p><strong>Panel 3</strong>. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-html-4" tabindex="0" role="tabpanel" aria-labelledby="tab-example-html-4" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="w-4 h-4 mr-xs" aria-label="Borrar" role="img" focusable="false"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="M100.625 122.5h-61.25a8.75 8.75 0 0 1-8.75-8.75V35h78.75v78.75a8.75 8.75 0 0 1-8.75 8.75zM56.875 96.25v-35M83.125 96.25v-35M13.125 35h113.75M83.125 17.5h-26.25a8.75 8.75 0 0 0-8.75 8.75V35h43.75v-8.75a8.75 8.75 0 0 0-8.75-8.75z" stroke-width="8.749995"/></g></svg> Tab 4</h3>
            <p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
</div>
<!-- /tabs -->

with disabled item

Contenido

Tab 1

Panel 1. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?

Show code

Macro

{% from "components/tabs/_macro.tabs.njk" import componentTabs %}
{{ componentTabs({
  "tablistAriaLabel": "Tab example",
  "idPrefix": "tab-example-disabled",
  "items": [
    {
      "text": "Tab 1",
      "panel": {
        "html": "<p><strong>Panel 1</strong>. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?</p>"
      }
    },
    {
      "text": "Tab 2",
      "disabled": true,
      "panel": {
        "html": "<p><strong>Panel 2</strong>. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    },
    {
      "text": "Tab 3",
      "panel": {
        "html": "<p><strong>Panel 3</strong>. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    },
    {
      "text": "Tab 4",
      "panel": {
        "html": "<p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    }
  ]
})  }}

Markup

<!-- tabs -->
<div class="c-tabs" data-module="c-tabs">
    <h2 class="lg:hidden mb-sm text-sm">Contenido</h2>
  <div class="c-tabs lg:flex lg:flex-wrap" role="tablist" aria-label="Tab example">
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="true" aria-controls="tab-tab-example-disabled-1" id="tab-example-disabled-1">
            <span class="flex items-center pointer-events-none">
              Tab 1
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none opacity-50 pointer-events-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-disabled-2" id="tab-example-disabled-2" tabindex="-1" disabled="disabled" aria-disabled="true">
            <span class="flex items-center pointer-events-none">
              Tab 2
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-disabled-3" id="tab-example-disabled-3" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 3
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-disabled-4" id="tab-example-disabled-4" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 4
            </span>
          </button>
  </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-disabled-1" tabindex="0" role="tabpanel" aria-labelledby="tab-example-disabled-1">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 1</h3>
            <p><strong>Panel 1</strong>. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-disabled-2" tabindex="0" role="tabpanel" aria-labelledby="tab-example-disabled-2" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 2</h3>
            <p><strong>Panel 2</strong>. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-disabled-3" tabindex="0" role="tabpanel" aria-labelledby="tab-example-disabled-3" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 3</h3>
            <p><strong>Panel 3</strong>. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-disabled-4" tabindex="0" role="tabpanel" aria-labelledby="tab-example-disabled-4" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 4</h3>
            <p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
</div>
<!-- /tabs -->

with classes applied

Show code to display the classes applied in html

Contenido

Tab 1

Panel 1. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?

Show code

Macro

{% from "components/tabs/_macro.tabs.njk" import componentTabs %}
{{ componentTabs({
  "tablistAriaLabel": "Tab example",
  "idPrefix": "tab-example-classes",
  "items": [
    {
      "text": "Tab 1",
      "panel": {
        "html": "<p><strong>Panel 1</strong>. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?</p>",
        "classes": "bg-warning-light"
      }
    },
    {
      "text": "Tab 2",
      "panel": {
        "html": "<p><strong>Panel 2</strong>. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>",
        "classes": "bg-warning-light"
      }
    },
    {
      "text": "Tab 3",
      "panel": {
        "html": "<p><strong>Panel 3</strong>. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>",
        "classes": "bg-warning-light"
      }
    },
    {
      "text": "Tab 4",
      "panel": {
        "html": "<p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>",
        "classes": "bg-warning-light"
      }
    }
  ]
})  }}

Markup

<!-- tabs -->
<div class="c-tabs" data-module="c-tabs">
    <h2 class="lg:hidden mb-sm text-sm">Contenido</h2>
  <div class="c-tabs lg:flex lg:flex-wrap" role="tablist" aria-label="Tab example">
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="true" aria-controls="tab-tab-example-classes-1" id="tab-example-classes-1">
            <span class="flex items-center pointer-events-none">
              Tab 1
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-classes-2" id="tab-example-classes-2" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 2
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-classes-3" id="tab-example-classes-3" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 3
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-classes-4" id="tab-example-classes-4" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 4
            </span>
          </button>
  </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base bg-warning-light" id="tab-tab-example-classes-1" tabindex="0" role="tabpanel" aria-labelledby="tab-example-classes-1">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 1</h3>
            <p><strong>Panel 1</strong>. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base bg-warning-light" id="tab-tab-example-classes-2" tabindex="0" role="tabpanel" aria-labelledby="tab-example-classes-2" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 2</h3>
            <p><strong>Panel 2</strong>. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base bg-warning-light" id="tab-tab-example-classes-3" tabindex="0" role="tabpanel" aria-labelledby="tab-example-classes-3" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 3</h3>
            <p><strong>Panel 3</strong>. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base bg-warning-light" id="tab-tab-example-classes-4" tabindex="0" role="tabpanel" aria-labelledby="tab-example-classes-4" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 4</h3>
            <p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
</div>
<!-- /tabs -->

with individual ids

See code to display the ids applied

Contenido

Tab 1

Panel 1. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?

Show code

Macro

{% from "components/tabs/_macro.tabs.njk" import componentTabs %}
{{ componentTabs({
  "tablistAriaLabel": "Tab example",
  "items": [
    {
      "text": "Tab 1",
      "id": "tab-example-a-1",
      "panel": {
        "html": "<p><strong>Panel 1</strong>. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?</p>"
      }
    },
    {
      "text": "Tab 2",
      "id": "tab-example-b-1",
      "panel": {
        "html": "<p><strong>Panel 2</strong>. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    },
    {
      "text": "Tab 3",
      "id": "tab-example-c",
      "panel": {
        "html": "<p><strong>Panel 3</strong>. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    },
    {
      "text": "Tab 4",
      "id": "tab-example-d",
      "panel": {
        "html": "<p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
      }
    }
  ]
})  }}

Markup

<!-- tabs -->
<div class="c-tabs" data-module="c-tabs">
    <h2 class="lg:hidden mb-sm text-sm">Contenido</h2>
  <div class="c-tabs lg:flex lg:flex-wrap" role="tablist" aria-label="Tab example">
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="true" aria-controls="tab-tab-example-a-1" id="tab-example-a-1">
            <span class="flex items-center pointer-events-none">
              Tab 1
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-b-1" id="tab-example-b-1" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 2
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-c" id="tab-example-c" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 3
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-d" id="tab-example-d" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Tab 4
            </span>
          </button>
  </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-a-1" tabindex="0" role="tabpanel" aria-labelledby="tab-example-a-1">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 1</h3>
            <p><strong>Panel 1</strong>. Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio?</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-b-1" tabindex="0" role="tabpanel" aria-labelledby="tab-example-b-1" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 2</h3>
            <p><strong>Panel 2</strong>. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-c" tabindex="0" role="tabpanel" aria-labelledby="tab-example-c" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 3</h3>
            <p><strong>Panel 3</strong>. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-d" tabindex="0" role="tabpanel" aria-labelledby="tab-example-d" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Tab 4</h3>
            <p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>
      </div>
</div>
<!-- /tabs -->

complex example

Example of a real use in an app

Contenido

Cambios

  • Ley 38/2003, de 17 de noviembre, General de Subvenciones. (BOE nº 276 de 18 de noviembre de 2003) y su Reglamento de desarrollo aprobado por Real Decreto 887/2006, de 21 de julio.

    Ver detalles de la normativa

  • Ley 5/2015, de 25 de marzo, de Subvenciones de Aragón. (BOA nº 68 de 10 de abril de 2015).
    Ver detalles de la normativa

Cambios realizados hace 2 horas

Show code

Macro

{% from "components/tabs/_macro.tabs.njk" import componentTabs %}
{{ componentTabs({
  "tablistAriaLabel": "Tab example",
  "items": [
    {
      "text": "Cambios",
      "id": "tab-example-a-2",
      "panel": {
        "html": "<div class=\"mb-base p-base bg-warning-light\"><ul class=\"c-ul mb-0\"><li><p>Ley 38/2003, de 17 de noviembre, General de Subvenciones. (BOE nº 276 de 18 de noviembre de 2003) y su Reglamento de desarrollo aprobado por Real Decreto 887/2006, de 21 de julio. </p><p><a href=\"#\" class=\"c-link text-sm\">Ver detalles de la normativa</a></p></li><li>Ley 5/2015, de 25 de marzo, de Subvenciones de Aragón. (BOA nº 68 de 10 de abril de 2015). <br><a href=\"#\" class=\"c-link text-sm\">Ver detalles de la normativa</a></li></ul></div><div class=\"flex items-baseline\"><p class=\"flex-1 text-sm text-neutral-dark\">Cambios realizados hace 2 horas</p><div class=\"ml-auto\"><button class=\"c-button c-button--transparent\">Descartar</button><button class=\"c-button c-button--transparent\">Editar</button></div></div>"
      }
    },
    {
      "text": "Ver original",
      "id": "tab-example-b-2",
      "panel": {
        "html": "<div class=\"mb-base p-base\"><ul class=\"c-ul mb-0\"><li><p>Ley 38/2003, de 17 de noviembre, General de Subvenciones. (BOE nº 276 de 11 de diciembre de 2020) y su Reglamento de desarrollo aprobado por Real Decreto 887/2006, de 21 de julio.</p><p><a href=\"#\" class=\"c-link text-sm\">Ver detalles de la normativa</a></p></li><li>Ley 5/2015, de 25 de marzo, de Subvenciones de Aragón. (BOA nº 68 de 10 de abril de 2015). <br><a href=\"#\" class=\"c-link text-sm\">Ver detalles de la normativa</a></li></ul></div><p class=\"text-sm text-neutral-dark\">Texto original</p>"
      }
    }
  ]
})  }}

Markup

<!-- tabs -->
<div class="c-tabs" data-module="c-tabs">
    <h2 class="lg:hidden mb-sm text-sm">Contenido</h2>
  <div class="c-tabs lg:flex lg:flex-wrap" role="tablist" aria-label="Tab example">
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="true" aria-controls="tab-tab-example-a-2" id="tab-example-a-2">
            <span class="flex items-center pointer-events-none">
              Cambios
            </span>
          </button>
          <button class="c-tabs__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none"
            role="tab" aria-selected="false" aria-controls="tab-tab-example-b-2" id="tab-example-b-2" tabindex="-1">
            <span class="flex items-center pointer-events-none">
              Ver original
            </span>
          </button>
  </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-a-2" tabindex="0" role="tabpanel" aria-labelledby="tab-example-a-2">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Cambios</h3>
            <div class="mb-base p-base bg-warning-light"><ul class="c-ul mb-0"><li><p>Ley 38/2003, de 17 de noviembre, General de Subvenciones. (BOE nº 276 de 18 de noviembre de 2003) y su Reglamento de desarrollo aprobado por Real Decreto 887/2006, de 21 de julio. </p><p><a href="#" class="c-link text-sm">Ver detalles de la normativa</a></p></li><li>Ley 5/2015, de 25 de marzo, de Subvenciones de Aragón. (BOA nº 68 de 10 de abril de 2015). <br><a href="#" class="c-link text-sm">Ver detalles de la normativa</a></li></ul></div><div class="flex items-baseline"><p class="flex-1 text-sm text-neutral-dark">Cambios realizados hace 2 horas</p><div class="ml-auto"><button class="c-button c-button--transparent">Descartar</button><button class="c-button c-button--transparent">Editar</button></div></div>
      </div>
      <div class="p-base mt-base lg:mt-0 border border-neutral-base focus:outline-none focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base" id="tab-tab-example-b-2" tabindex="0" role="tabpanel" aria-labelledby="tab-example-b-2" hidden="">
            <h3 class="lg:sr-only inline-flex items-center mb-base lg:mb-0 font-semibold">Ver original</h3>
            <div class="mb-base p-base"><ul class="c-ul mb-0"><li><p>Ley 38/2003, de 17 de noviembre, General de Subvenciones. (BOE nº 276 de 11 de diciembre de 2020) y su Reglamento de desarrollo aprobado por Real Decreto 887/2006, de 21 de julio.</p><p><a href="#" class="c-link text-sm">Ver detalles de la normativa</a></p></li><li>Ley 5/2015, de 25 de marzo, de Subvenciones de Aragón. (BOA nº 68 de 10 de abril de 2015). <br><a href="#" class="c-link text-sm">Ver detalles de la normativa</a></li></ul></div><p class="text-sm text-neutral-dark">Texto original</p>
      </div>
</div>
<!-- /tabs -->