48 lines
1.0 KiB
TypeScript
48 lines
1.0 KiB
TypeScript
"use client"
|
|
|
|
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs"
|
|
|
|
import { cn } from "@/lib/utils"
|
|
|
|
function Tabs({ className, ...props }: TabsPrimitive.Root.Props) {
|
|
return (
|
|
<TabsPrimitive.Root
|
|
data-slot="tabs"
|
|
className={cn("flex flex-col gap-2", className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function TabsList({ className, ...props }: TabsPrimitive.List.Props) {
|
|
return (
|
|
<TabsPrimitive.List
|
|
data-slot="tabs-list"
|
|
className={cn("inline-flex w-fit items-center", className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props) {
|
|
return (
|
|
<TabsPrimitive.Tab
|
|
data-slot="tabs-trigger"
|
|
className={cn("inline-flex items-center justify-center", className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function TabsContent({ className, ...props }: TabsPrimitive.Panel.Props) {
|
|
return (
|
|
<TabsPrimitive.Panel
|
|
data-slot="tabs-content"
|
|
className={cn("outline-none", className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export { Tabs, TabsContent, TabsList, TabsTrigger }
|