Fully accessible tabs with keyboard navigation and ARIA support
Standard tabs component with horizontal navigation
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
⭐⭐⭐⭐⭐ "Great product, very satisfied!" - John K.
⭐⭐⭐⭐ "Good quality for the price." - Mary V.
Tabs with a border around the content
Welcome to your dashboard. Here you'll find an overview of all activities.
Application configuration and user preferences.
Edit your personal information and account settings.
Archived items (this tab is disabled).
Tabs styled as pills/buttons
Overview of key metrics and statistics.
Graphical display of data and trends.
Exportable reports and analyses.
Tabs with vertical navigation (displayed horizontally on mobile)
Manage basic account information.
Password settings and two-factor authentication.
Configure email and push notifications.
Visibility and data sharing settings.
Tabs with counters or badge indicators
Showing all 24 tasks regardless of status.
12 tasks you're currently working on.
10 tasks you've already finished.
2 archived tasks for future reference.
Tabs with smooth transitions between panels
Content with fade animation when switching.
Smooth transition between content.
Last panel with animated transition.
<div data-tabs>
<div role="tablist" data-tabs-list>
<button data-tabs-tab>Tab 1</button>
<button data-tabs-tab>Tab 2</button>
<button data-tabs-tab>Tab 3</button>
</div>
<div data-tabs-panel>
Tab 1 content
</div>
<div data-tabs-panel>
Tab 2 content
</div>
<div data-tabs-panel>
Tab 3 content
</div>
</div>
import { initTabs } from './a11y-kit/a11y-tabs.js';
// Initialize after DOM is ready
document.addEventListener('DOMContentLoaded', () => {
initTabs();
});
import { Tabs } from './a11y-kit/a11y-tabs.js';
const tabs = new Tabs(element, {
activeIndex: 0,
automatic: true,
orientation: 'horizontal',
onChange: (tab, panel, index) => console.log('Tab changed:', index),
onTabClick: (tab, index) => console.log('Clicked:', index)
});
npm install accessible-kit
// Import only what you need (best for tree-shaking)
import { initTabs, Tabs } from 'accessible-kit/tabs';
// Initialize after DOM is ready
document.addEventListener('DOMContentLoaded', () => {
initTabs(); // Auto-init all tabs
// OR create instances manually
const tabs = new Tabs(element, options);
});
<!-- Boxed variant -->
<div data-tabs data-variant="boxed">...</div>
<!-- Pills variant -->
<div data-tabs data-variant="pills">...</div>
<!-- Vertical variant -->
<div data-tabs data-orientation="vertical">...</div>
<!-- Fade animations are default -->
<div data-tabs>...</div>
<!-- Disable animations -->
<div data-tabs data-no-animation>...</div>
<!-- Disabled tab -->
<button data-tabs-tab disabled>Disabled</button>
<!-- Badge (optional class for styling) -->
<span class="tabs__tab-badge">12</span>