Installation
Usage
Props
Array of tab items to display. Each item includes:
id(string): Unique identifier for the tabtitle(string): Display text for the tabicon(LucideIcon, optional): Icon component to displaycontent(ReactNode, optional): Content to show when tab is activecardContent(ReactNode, optional): Card content to display above tabscolor(string): Background color classes for the tab (e.g., “bg-blue-500 hover:bg-blue-600”)
ID of the tab that should be selected by default
Additional CSS classes to apply to the tab container
Background color for the active tab sliding indicator
Callback function triggered when tab selection changes
Features
- Smooth Animations: Slide transitions with blur and scale effects using Framer Motion
- Card Content Display: Shows customizable card content above the tab bar
- Sliding Indicator: Animated background that smoothly moves to the active tab
- Keyboard Accessible: Supports Enter and Space key navigation
- Responsive Layout: Automatically adjusts to container width
- Customizable Colors: Each tab can have its own color scheme
Example with Custom Tabs
Dependencies
motion(Framer Motion)lucide-react@/lib/utils(cn utility)