This commit is contained in:
Vula Builder
2026-07-15 09:25:23 +00:00
parent 5c4952ab97
commit e9702d6e02
+32
View File
@@ -0,0 +1,32 @@
import { cn } from "@/lib/utils"
import { forwardRef } from "react"
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
variant?: "primary" | "secondary" | "outline"
}
const Badge = forwardRef<HTMLSpanElement, BadgeProps>(
({ className, variant = "primary", children, ...props }, ref) => {
return (
<span
ref={ref}
className={cn(
"inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
{
"bg-primary text-primary-foreground hover:bg-primary/80": variant === "primary",
"bg-secondary text-secondary-foreground hover:bg-secondary/80": variant === "secondary",
"border border-border bg-background text-foreground hover:bg-accent": variant === "outline"
},
className
)}
{...props}
>
{children}
</span>
)
}
)
Badge.displayName = "Badge"
export default Badge