Skip to main content
Version: 1.0.3

Tab

The Tabs component is a versatile navigation interface that allows users to switch between different views within the same context. Built with Framer Motion for smooth animations and powered by Class Variance Authority for flexible styling, it provides multiple variants and themes for different design needs.

Installation

ignix add component tab

Usage

Import the component:

import { Tabs } from '@ignix-ui/tab';

Basic Usage

function BasicTabs() {
return (
<Tabs
options={["Tab 1", "Tab 2", "Tab 3"]}
selected={0}
value={(index) => console.log(`Selected tab: ${index}`)}
/>
);
}

Props

PropTypeDefaultDescription
optionsstring[]requiredArray of tab labels to render
selectednumber0Index of the initially selected tab
value(index: number) => voidundefinedCallback fired with the index of the newly selected tab
variant'underline' | 'filled' | 'pill' | 'outline' | 'ghost' | 'shadow' | 'gradient' | 'glow' | 'block''underline'Visual style of the tab strip
theme'light' | 'dark' | 'glass' | 'glassDark' | 'glassLight' | 'glassGradient' | 'glassGradientDark'undefinedColor theme applied to the tab container
size'sm' | 'md' | 'lg''md'Font size of the tab labels
classNamestringundefinedAdditional Tailwind classes applied to the tab container