({
className,
variant,
size,
asChild = false,
...props
}: React.ComponentProps<"button"> &
VariantProps<typeof buttonVariants> & {
asChild?: boolean
})
| 39 | ) |
| 40 | |
| 41 | function Button({ |
| 42 | className, |
| 43 | variant, |
| 44 | size, |
| 45 | asChild = false, |
| 46 | ...props |
| 47 | }: React.ComponentProps<"button"> & |
| 48 | VariantProps<typeof buttonVariants> & { |
| 49 | asChild?: boolean |
| 50 | }) { |
| 51 | const Comp = asChild ? Slot : "button" |
| 52 | |
| 53 | return ( |
| 54 | <Comp |
| 55 | data-slot="button" |
| 56 | className={cn(buttonVariants({ variant, size, className }))} |
| 57 | {...props} |
| 58 | /> |
| 59 | ) |
| 60 | } |
| 61 | |
| 62 | export { Button, buttonVariants } |
nothing calls this directly
no test coverage detected
searching dependent graphs…