button.tsx — ui Source File
Architecture documentation for button.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 73ca083b_31a0_2e6a_de08_56e61803f9bb["button.tsx"] f4cd8293_21dc_9d7b_f303_e5edbee1351e["button"] 73ca083b_31a0_2e6a_de08_56e61803f9bb --> f4cd8293_21dc_9d7b_f303_e5edbee1351e 25383e8d_ca91_a50e_c3a8_5f228d02e1df["class-variance-authority"] 73ca083b_31a0_2e6a_de08_56e61803f9bb --> 25383e8d_ca91_a50e_c3a8_5f228d02e1df 8ad666ec_1b20_adda_0392_87a60bdb3a68["utils"] 73ca083b_31a0_2e6a_de08_56e61803f9bb --> 8ad666ec_1b20_adda_0392_87a60bdb3a68 style 73ca083b_31a0_2e6a_de08_56e61803f9bb fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import { Button as ButtonPrimitive } from "@base-ui/react/button"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/registry/bases/base/lib/utils"
const buttonVariants = cva(
"cn-button inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",
{
variants: {
variant: {
default: "cn-button-variant-default",
outline: "cn-button-variant-outline",
secondary: "cn-button-variant-secondary",
ghost: "cn-button-variant-ghost",
destructive: "cn-button-variant-destructive",
link: "cn-button-variant-link",
},
size: {
default: "cn-button-size-default",
xs: "cn-button-size-xs",
sm: "cn-button-size-sm",
lg: "cn-button-size-lg",
icon: "cn-button-size-icon",
"icon-xs": "cn-button-size-icon-xs",
"icon-sm": "cn-button-size-icon-sm",
"icon-lg": "cn-button-size-icon-lg",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)
function Button({
className,
variant = "default",
size = "default",
...props
}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
return (
<ButtonPrimitive
data-slot="button"
className={cn(buttonVariants({ variant, size, className }))}
{...props}
/>
)
}
export { Button, buttonVariants }
Domain
Subdomains
Functions
Dependencies
- button
- class-variance-authority
- utils
Source
Frequently Asked Questions
What does button.tsx do?
button.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, UIPrimitives subdomain.
What functions are defined in button.tsx?
button.tsx defines 1 function(s): Button.
What does button.tsx depend on?
button.tsx imports 3 module(s): button, class-variance-authority, utils.
Where is button.tsx in the architecture?
button.tsx is located at apps/v4/registry/bases/base/ui/button.tsx (domain: ComponentRegistry, subdomain: UIPrimitives, directory: apps/v4/registry/bases/base/ui).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free