Navigation
Tabs
Tabs let users switch between different views or functional sections without leaving the current page. Quanta’s tab component is lightweight, theme-aware, and fully responsive.
Markup
Basic structure consists of:
.quanta-tabscontainer for tab buttons..quanta-tabfor each tab; add.activeto highlight..quanta-tab-contentwrapper for panels..quanta-tab-panelfor each content pane; add.activeto show.
<div class="quanta-tabs">
<button class="quanta-tab active">Tab 1</button>
<button class="quanta-tab">Tab 2</button>
<button class="quanta-tab">Tab 3</button>
</div>
<div class="quanta-tab-content">
<div class="quanta-tab-panel active">Content 1</div>
<div class="quanta-tab-panel">Content 2</div>
<div class="quanta-tab-panel">Content 3</div>
</div>
This is the first tab’s content.
Here’s content for tab two.
Finally, tab three content.
Visual Variants
You can tweak appearance with utility classes:
Underline Style (default)
Outline Tabs
Add .quanta-tabs-outline to switch the bottom border into a full outline:
Tab Sizes
Use .quanta-tab-sm or .quanta-tab-lg to adjust padding/font-size.
Responsive Behavior
On mobile (<640px), tabs stack vertically and stretch 100% width.
Accessibility
Ensure each .quanta-tab is a focusable element (e.g. <button>). When toggling tabs via JavaScript, update:
aria-selected="true"on the active tab, andaria-selected="false"on others.role="tablist"on the.quanta-tabscontainer.role="tab"on each tab, androle="tabpanel"on panels.