tabs.tsx — ui Source File
Architecture documentation for tabs.tsx, a tsx file in the ui codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR d66df814_2ad1_25c1_8f7d_68ee351b7711["tabs.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] d66df814_2ad1_25c1_8f7d_68ee351b7711 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 25383e8d_ca91_a50e_c3a8_5f228d02e1df["class-variance-authority"] d66df814_2ad1_25c1_8f7d_68ee351b7711 --> 25383e8d_ca91_a50e_c3a8_5f228d02e1df 9c463da6_747b_38dc_586b_cbb4873070b1["radix-ui"] d66df814_2ad1_25c1_8f7d_68ee351b7711 --> 9c463da6_747b_38dc_586b_cbb4873070b1 79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"] d66df814_2ad1_25c1_8f7d_68ee351b7711 --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81 style d66df814_2ad1_25c1_8f7d_68ee351b7711 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { Tabs as TabsPrimitive } from "radix-ui"
import { cn } from "@/lib/utils"
function Tabs({
className,
orientation = "horizontal",
...props
}: React.ComponentProps<typeof TabsPrimitive.Root>) {
return (
<TabsPrimitive.Root
data-slot="tabs"
data-orientation={orientation}
orientation={orientation}
className={cn(
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
className
)}
{...props}
/>
)
}
const tabsListVariants = cva(
"rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
{
variants: {
variant: {
default: "bg-muted",
line: "gap-1 bg-transparent",
},
},
defaultVariants: {
variant: "default",
},
}
)
function TabsList({
className,
variant = "default",
...props
}: React.ComponentProps<typeof TabsPrimitive.List> &
VariantProps<typeof tabsListVariants>) {
return (
<TabsPrimitive.List
data-slot="tabs-list"
data-variant={variant}
className={cn(tabsListVariants({ variant }), className)}
{...props}
/>
)
}
function TabsTrigger({
className,
...props
}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
return (
<TabsPrimitive.Trigger
data-slot="tabs-trigger"
className={cn(
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent",
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground",
"after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",
className
)}
{...props}
/>
)
}
function TabsContent({
className,
...props
}: React.ComponentProps<typeof TabsPrimitive.Content>) {
return (
<TabsPrimitive.Content
data-slot="tabs-content"
className={cn("flex-1 outline-none", className)}
{...props}
/>
)
}
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
Domain
Subdomains
Dependencies
- class-variance-authority
- radix-ui
- react
- utils
Source
Frequently Asked Questions
What does tabs.tsx do?
tabs.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in tabs.tsx?
tabs.tsx defines 4 function(s): Tabs, TabsContent, TabsList, TabsTrigger.
What does tabs.tsx depend on?
tabs.tsx imports 4 module(s): class-variance-authority, radix-ui, react, utils.
Where is tabs.tsx in the architecture?
tabs.tsx is located at apps/v4/registry/new-york-v4/ui/tabs.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: apps/v4/registry/new-york-v4/ui).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free