summaryrefslogtreecommitdiffstats
path: root/docs/theme/ExampleTabs.jinja
blob: 0853ec53d4858f2a5ed2e0e9dc10f77bd52291ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{#def prefix, panels={} #}

<div {{ attrs.render(
  class="cd-example-tabs not-prose",
  data_component="ExampleTabs",
) }}>
  <TabGroup class="example-tabgroup">
    <TabList class="example-tablist" data-md-skip>
      {%- for text in panels.keys() %}
      <Tab
        class="example-tab"
        target={{ "ex-%s-%s" % (prefix, loop.index) }}
        selected={{ loop.index == 1 }}
      >{{ text }}</Tab>
      {%- endfor %}
    </TabList>
    {%- for name in panels.values() %}
    <TabPanel
      class="example-tabpanel"
      id={{ "ex-%s-%s" % (prefix, loop.index) }}
      hidden={{ loop.index != 1 }}
    >
      {{ catalog.irender(name) }}
    </TabPanel>
    {%- endfor %}
  </TabGroup>
</div>