Command Palette

Search for a command to run...

0
Components

Magic Genie Tabs

macOS-style genie animation with a sleek glass pill nav bar

Overview

This is the overview section. Add any content here — text, cards, charts, anything. The panel scrolls if you add more content.

Dummy content line 1

Dummy content line 2

Dummy content line 3

Dummy content line 4

Dummy content line 5

Dummy content line 6

Dummy content line 7

Dummy content line 8

Dummy content line 9

Dummy content line 10

Dummy content line 11

Dummy content line 12

Dummy content line 13

Dummy content line 14

Dummy content line 15

Dummy content line 16

Dummy content line 17

Dummy content line 18

Dummy content line 19

Dummy content line 20

Dummy content line 21

Dummy content line 22

Dummy content line 23

Dummy content line 24

Dummy content line 25

Dummy content line 26

Dummy content line 27

Dummy content line 28

Dummy content line 29

Dummy content line 30

Dummy content line 31

Dummy content line 32

Dummy content line 33

Dummy content line 34

Dummy content line 35

Dummy content line 36

Dummy content line 37

Dummy content line 38

Dummy content line 39

Dummy content line 40

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.

PropTypeDefaultDescription
tabsMagicTabItem[]Array of tab objects. See MagicTabItem below.
containerClassNamestringExtra classes for the outer wrapper (div around tabs + panel).
tabClassNamestringShared classes applied to each tab button.
activeTabClassNamestringExtra classes merged into the active pill highlight.
contentClassNamestringClasses 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.

PropTypeDefaultDescription
titlestringLabel text shown on the tab pill and used to identify the tab.
valuestringUnique value for the tab (used for keys and active tab comparison).
contentReact.ReactNodeReact node rendered inside the genie content panel when tab is active.
gradientstringOptional CSS gradient string used as a subtle animated wash behind content.