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 | asChild = false, |
| 40 | ...props |
| 41 | }: React.ComponentProps<"button"> & { |
| 42 | variant?: ButtonVariant | null |
| 43 | size?: ButtonSize | null |
| 44 | asChild?: boolean |
| 45 | }) { |
| 46 | const Comp = asChild ? Slot.Root : "button" |
| 47 | const resolvedVariant = variant ?? "default" |
| 48 | const resolvedSize = size ?? "default" |
| 49 | |
| 50 | return ( |
| 51 | <Comp |
| 52 | data-slot="button" |
| 53 | data-variant={resolvedVariant} |
| 54 | data-size={resolvedSize} |
| 55 | className={buttonClassName({ ...VARIANT[resolvedVariant], ...SIZE[resolvedSize], className })} |
| 56 | {...props} |
| 57 | /> |
| 58 | ) |
| 59 | } |
| 60 | |
| 61 | export { Button } |
Callers
nothing calls this directly
Tested by
no test coverage detected