Tabs
Tab navigation for organizing content across multiple panels.
Auto-Initialized
Add data-tab="id" to your tab buttons and they work automatically!
Or control them with Tabs.switch('id') - just one line.
Basic Tabs
Default tab navigation with underline indicator:
Overview
Use tabs to organize related information into separate views.
Profile
Each panel can contain any HTML content.
Settings
Tabs provide a clean way to organize complex interfaces.
<div class="focus-tabs">
<div class="focus-tab-list">
<button class="focus-tab focus-tab-active" data-tab="tab1">Overview</button>
<button class="focus-tab" data-tab="tab2">Profile</button>
<button class="focus-tab" data-tab="tab3">Settings</button>
</div>
<div class="focus-tab-panels">
<div class="focus-tab-panel focus-tab-panel-active" data-tab="tab1">
<p>Overview content</p>
</div>
<div class="focus-tab-panel" data-tab="tab2">
<p>Profile content</p>
</div>
<div class="focus-tab-panel" data-tab="tab3">
<p>Settings content</p>
</div>
</div>
</div>
It Just Works
Tabs with data-tab attributes are automatically interactive.
No manual JavaScript required!
Pills Style
Pill-shaped tabs with filled background using .focus-tabs-pills:
Dashboard content with key metrics.
Analytics with detailed data.
Reports with generated documents.
<div class="focus-tabs focus-tabs-pills">
<!-- tabs here -->
</div>
Boxed Style
Card-like appearance using .focus-tabs-boxed:
Monthly statistics.
Yearly trends.
All-time data.
<div class="focus-tabs focus-tabs-boxed">
<!-- tabs here -->
</div>
Vertical Tabs
Vertical layout with .focus-tabs-vertical:
Account Settings
Manage your account information.
Notifications
Control your notification preferences.
Privacy
Configure privacy and security options.
<div class="focus-tabs focus-tabs-vertical">
<!-- tabs here -->
</div>
JavaScript API
Tabs are auto-initialized via data-tab attributes. Use the API for programmatic control.
Home content
Profile content
Settings content
Switch Tab
Tabs.switch('profile')
Tabs.switch('settings', '#myTabs')
Methods
| Method | Description |
|---|---|
Tabs.switch(tabId, container?) |
Switch to a tab by ID. Container defaults to first .focus-tabs on page. |
CSS Classes Reference
| Class | Description |
|---|---|
.focus-tabs |
Main container |
.focus-tab-list |
Tab buttons container |
.focus-tab |
Individual tab button |
.focus-tab-active |
Active tab state |
.focus-tab-panels |
Panels container |
.focus-tab-panel |
Individual panel |
.focus-tab-panel-active |
Active panel (visible) |
.focus-tabs-pills |
Pills style variant |
.focus-tabs-boxed |
Boxed style variant |
.focus-tabs-vertical |
Vertical layout |