{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "fluid-tabs", "title": "Fluid Tabs", "description": "Tabs with Framer Motion layout-animated underline or pill indicator", "dependencies": [ "motion" ], "files": [ { "path": "registry/pioneerui/fluid-tabs.tsx", "content": "\"use client\"\n\nimport React, { useState, useRef } from \"react\"\nimport { motion } from \"motion/react\"\nimport { cn } from \"@/lib/utils\"\n\nexport interface FluidTabItem {\n value: string\n label: string\n content?: React.ReactNode\n icon?: React.ReactNode\n}\n\nexport interface FluidTabsProps {\n tabs: FluidTabItem[]\n defaultValue?: string\n onChange?: (value: string) => void\n className?: string\n listClassName?: string\n contentClassName?: string\n variant?: \"underline\" | \"pill\"\n}\n\nexport function FluidTabs({\n tabs,\n defaultValue,\n onChange,\n className,\n listClassName,\n contentClassName,\n variant = \"underline\",\n}: FluidTabsProps) {\n const [active, setActive] = useState(defaultValue ?? tabs[0]?.value ?? \"\")\n\n const handleChange = (value: string) => {\n setActive(value)\n onChange?.(value)\n }\n\n const activeTab = tabs.find((t) => t.value === active)\n\n return (\n
\n {/* Tab List */}\n \n {tabs.map((tab) => (\n handleChange(tab.value)}\n className={cn(\n \"relative flex items-center gap-1.5 px-3 py-2 text-sm font-medium transition-colors duration-150 focus-visible:outline-none\",\n variant === \"underline\"\n ? cn(\n \"rounded-t-md\",\n active === tab.value\n ? \"text-foreground\"\n : \"text-muted-foreground hover:text-foreground\",\n )\n : cn(\n \"rounded-lg z-10\",\n active === tab.value ? \"text-foreground\" : \"text-muted-foreground hover:text-foreground\",\n ),\n )}\n >\n {/* Underline indicator */}\n {variant === \"underline\" && active === tab.value && (\n \n )}\n {/* Pill indicator */}\n {variant === \"pill\" && active === tab.value && (\n \n )}\n {tab.icon && {tab.icon}}\n {tab.label}\n \n ))}\n
\n\n {/* Tab Content */}\n {activeTab?.content && (\n \n {activeTab.content}\n \n )}\n \n )\n}\n", "type": "registry:ui", "target": "components/pioneerui/fluid-tabs.tsx" } ], "type": "registry:ui" }