Function
Button
({
className,
variant = "default",
size = "default",
asChild = false,
...props
}: React.ComponentProps<"button"> &
VariantProps<typeof buttonVariants> & {
asChild?: boolean
})
Source from the content-addressed store, hash-verified
| 39 | ) |
| 40 | |
| 41 | function Button({ |
| 42 | className, |
| 43 | variant = "default", |
| 44 | size = "default", |
| 45 | asChild = false, |
| 46 | ...props |
| 47 | }: React.ComponentProps<"button"> & |
| 48 | VariantProps<typeof buttonVariants> & { |
| 49 | asChild?: boolean |
| 50 | }) { |
| 51 | const Comp = asChild ? Slot.Root : "button" |
| 52 | |
| 53 | return ( |
| 54 | <Comp |
| 55 | data-slot="button" |
| 56 | data-variant={variant} |
| 57 | data-size={size} |
| 58 | className={cn(buttonVariants({ variant, size, className }))} |
| 59 | {...props} |
| 60 | /> |
| 61 | ) |
| 62 | } |
| 63 | |
| 64 | export { Button, buttonVariants } |
Callers
nothing calls this directly
Tested by
no test coverage detected