--- layout: layouts/page.njk title: Tabs description: A set of layered sections of content—known as tab panels—that are displayed one at a time. toc: - label: Usage id: usage children: - label: HTML + JavaScript id: usage-default - label: Jinja and Nunjucks id: usage-macro --- {% from "macros/code_preview.njk" import code_preview %} {% from "macros/code_block.njk" import code_block %} {% from "tabs.njk" import tabs %} {% set code_html %} {% set account_panel %}
Make changes to your account here. Click save when you're done.
Change your password here. After saving, you'll be logged out.
Include the tabs.js file. Add this to the <head> of your page:
<div class="tabs"><nav role="tablist" aria-orientation="horizontal"><button role="tab" id="{ TAB_ID }" aria-controls="{ PANEL_ID }" aria-selected="false" tabindex="0">aria-selected attribute is set to true. tabindex="0" is required for keyboard navigation.<div role="tabpanel" id="{ PANEL_ID }" aria-labelledby="{ TAB_ID }" tabindex="-1" aria-selected="false">aria-selected attribute is set to true.You can use the tabs() Nunjucks or Jinja macro for this component.
Make changes to your account here. Click save when you're done.
Change your password here. After saving, you'll be logged out.