diff options
Diffstat (limited to 'docs/theme/ExampleTabs.jinja')
-rw-r--r-- | docs/theme/ExampleTabs.jinja | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/theme/ExampleTabs.jinja b/docs/theme/ExampleTabs.jinja new file mode 100644 index 0000000..0853ec5 --- /dev/null +++ b/docs/theme/ExampleTabs.jinja @@ -0,0 +1,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> |