Home / Function/ Button() — ui Function Reference

Button() — ui Function Reference

Architecture documentation for the Button() function in button.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  70768669_c979_ca3e_947c_6b32bfa053e8["Button()"]
  34ac5910_4af9_fb5f_32e9_c28c61284974["button.tsx"]
  70768669_c979_ca3e_947c_6b32bfa053e8 -->|defined in| 34ac5910_4af9_fb5f_32e9_c28c61284974
  style 70768669_c979_ca3e_947c_6b32bfa053e8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/registry/new-york-v4/ui/button.tsx lines 41–62

function Button({
  className,
  variant = "default",
  size = "default",
  asChild = false,
  ...props
}: React.ComponentProps<"button"> &
  VariantProps<typeof buttonVariants> & {
    asChild?: boolean
  }) {
  const Comp = asChild ? Slot.Root : "button"

  return (
    <Comp
      data-slot="button"
      data-variant={variant}
      data-size={size}
      className={cn(buttonVariants({ variant, size, className }))}
      {...props}
    />
  )
}

Subdomains

Frequently Asked Questions

What does Button() do?
Button() is a function in the ui codebase, defined in apps/v4/registry/new-york-v4/ui/button.tsx.
Where is Button() defined?
Button() is defined in apps/v4/registry/new-york-v4/ui/button.tsx at line 41.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free