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
  df455c34_0138_5370_71a4_b705b0533dd8["Button()"]
  030d173b_5eeb_66a1_8028_5c9b8baff0e2["button.tsx"]
  df455c34_0138_5370_71a4_b705b0533dd8 -->|defined in| 030d173b_5eeb_66a1_8028_5c9b8baff0e2
  style df455c34_0138_5370_71a4_b705b0533dd8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/radix/ui/button.tsx lines 43–64

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/examples/radix/ui/button.tsx.
Where is Button() defined?
Button() is defined in apps/v4/examples/radix/ui/button.tsx at line 43.

Analyze Your Own Codebase

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

Try Supermodel Free