Magic Genie Tabs
macOS-style genie animation with a sleek glass pill nav bar
magic-genie-tabs-demo.tsx
import { Tabs } from "@/registry/magic-genie-tabs/magic-genie-tabs";
export function MagicGenieTabsDemo() {
const tabs = [
{
title: "Overview",
value: "overview",
content: (
<div>
<h2 className="text-xl font-semibold mb-3">Overview</h2>
<p>
This is the overview section. Add any content here — text, cards,
charts, anything. The panel scrolls if you add more content.
</p>
</div>
),
},
{
title: "Analytics",
value: "analytics",
content: (
<div>
<h2 className="text-xl font-semibold mb-3">Analytics</h2>
<p>Imagine charts here 📈 This tab opens with the same genie effect.</p>
</div>
),
},
{
title: "Settings",
value: "settings",
content: (
<div>
<h2 className="text-xl font-semibold mb-3">Settings</h2>
<p>Update preferences, security, and profile details here.</p>
</div>
),
},
];
return <Tabs tabs={tabs} />;
}Magic Genie Tabs
macOS-style genie animation with a sleek glass pill nav bar.
Features
- macOS-style genie animation that expands from the tab
- Sleek glass pill navigation bar with backdrop blur
- Smooth spring-based animations for tab switching
- Scrollable content panel with custom scrollbar styling
- Fully customizable with className props
- Light and dark theme support
- Responsive design that works on all screen sizes
Installation
pnpm dlx shadcn add https://darshitdev.in/r/magic-genie-tabs
Usage
import { Tabs } from "@/registry/magic-genie-tabs/magic-genie-tabs";
<Tabs
tabs={[
{
title: 'Overview',
value: 'overview',
content: <div>Content goes here</div>,
gradient: 'bg-gradient-to-br from-purple-700/50 to-violet-900/50'
},
{
title: 'Settings',
value: 'settings',
content: <div>More content</div>
}
]}
containerClassName="mb-8"
tabClassName="custom-tab"
activeTabClassName="custom-active"
contentClassName="custom-content"
/>API Reference
MagicGenieTabs
The root component that provides the genie-style tab navigation + content panel.
| Prop | Type | Default | Description |
|---|---|---|---|
tabs | MagicTabItem[] | – | Array of tab objects. See MagicTabItem below. |
containerClassName | string | – | Extra classes for the outer wrapper (div around tabs + panel). |
tabClassName | string | – | Shared classes applied to each tab button. |
activeTabClassName | string | – | Extra classes merged into the active pill highlight. |
contentClassName | string | – | Classes applied to the content panel container. |
The component expects tabs to be stable; it internally manages activeIndex and animates the shared pill between items.
MagicTabItem
The shape of each tab object passed in the tabs array.
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | – | Label text shown on the tab pill and used to identify the tab. |
value | string | – | Unique value for the tab (used for keys and active tab comparison). |
content | React.ReactNode | – | React node rendered inside the genie content panel when tab is active. |
gradient | string | – | Optional CSS gradient string used as a subtle animated wash behind content. |