Function
Badge
({
className,
variant = "default",
asChild = false,
...props
}: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & { asChild?: boolean })
Source from the content-addressed store, hash-verified
| 26 | ); |
| 27 | |
| 28 | function Badge({ |
| 29 | className, |
| 30 | variant = "default", |
| 31 | asChild = false, |
| 32 | ...props |
| 33 | }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) { |
| 34 | const Comp = asChild ? Slot.Root : "span"; |
| 35 | |
| 36 | return ( |
| 37 | <Comp |
| 38 | data-slot="badge" |
| 39 | data-variant={variant} |
| 40 | className={cn(badgeVariants({ variant }), className)} |
| 41 | {...props} |
| 42 | /> |
| 43 | ); |
| 44 | } |
| 45 | |
| 46 | export { Badge, badgeVariants }; |
Callers
nothing calls this directly
Tested by
no test coverage detected