GodUI

Magic Tab

A segmented tab bar where the selected option lifts into a 3D button with an optional rainbow edge.

Installation

pnpm dlx shadcn@latest add "https://godui.design/r/magic-tab.json"

Usage

tsx
 
import { MagicTab } from "@/components/godui/magic-tab";
tsx
 
const items = [
  { value: "overview", label: "Overview" },
  { value: "analytics", label: "Analytics" },
  { value: "reports", label: "Reports" },
];

<MagicTab items={items} defaultValue="overview" />;

Use it controlled by passing value and onValueChange:

tsx
 
const [value, setValue] = useState("overview");

<MagicTab items={items} value={value} onValueChange={setValue} />;

Examples

Secondary

Without rainbow

Disabled tab

Mark any item disabled to skip it.

Sizes

Props

PropTypeDefaultDescription
itemsMagicTabItem[]Tabs to render: { value, label, disabled? }
valuestringControlled selected value
defaultValuestringfirst enabled itemUncontrolled initial value
onValueChange(value: string) => voidCalled when the selected tab changes
variant"default" | "secondary""default"Selected-tab color scheme
size"sm" | "md" | "lg""md"Tab padding and text size
rainbowbooleantrueAnimate the selected tab's 3D edge and shadow with a rainbow gradient

On this page

Built with GodUI

Beautifully crafted motion components for modern interfaces.

Star on GitHub