{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "native-tabs-carbon", "type": "registry:component", "title": "Native Tabs", "description": "A sleek tabs component with a smooth sliding background indicator using Framer Motion layout animations.", "dependencies": [ "framer-motion", "react" ], "files": [ { "path": "@uitripled/react-carbon/src/components/native/native-tabs-carbon.tsx", "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { motion } from \"framer-motion\";\nimport { useState } from \"react\";\n\ninterface NativeTabsProps {\n items: {\n id: string;\n label: string;\n content: React.ReactNode;\n }[];\n defaultValue?: string;\n className?: string;\n}\n\nexport function NativeTabs({\n items,\n defaultValue,\n className,\n}: NativeTabsProps) {\n const [activeTab, setActiveTab] = useState(defaultValue || items[0].id);\n\n return (\n
\n
\n {items.map((tab) => {\n const isActive = activeTab === tab.id;\n return (\n setActiveTab(tab.id)}\n className={cn(\n \"relative z-10 flex-1 rounded-lg px-4 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n isActive\n ? \"text-foreground\"\n : \"text-muted-foreground hover:text-foreground\"\n )}\n >\n {isActive && (\n \n )}\n {tab.label}\n \n );\n })}\n
\n
\n \n {items.find((item) => item.id === activeTab)?.content}\n \n
\n
\n );\n}\n", "type": "registry:component", "target": "components/uitripled/native-tabs-carbon.tsx" } ] }