badge
neobrutalui/badgeFreeComponent
Label items with status or category tags.
Live preview
live · rendered by the registry
Rendered by neobrutalui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.neobrutalui.live/r/badge.jsonSource
1import * as React from "react"2import { cva, type VariantProps } from "class-variance-authority"3import { cn } from "@/lib/utils"45const badgeVariants = cva(6 "inline-flex items-center rounded-base border-2 border-black px-2.5 py-0.5 text-xs font-bold",7 {8 variants: {9 variant: {10 default:11 "bg-main text-black",12 neutral:13 "bg-white text-black",14 destructive: "bg-hot-pink text-black",15 success: "bg-mint text-black",16 warning: "bg-lemon text-black",17 },18 },19 defaultVariants: {20 variant: "default",21 },22 }23)2425export interface BadgeProps26 extends React.HTMLAttributes<HTMLDivElement>,27 VariantProps<typeof badgeVariants> { }2829const Badge = React.forwardRef<HTMLDivElement, BadgeProps>(30 ({ className, variant, ...props }, ref) => {31 return (32 <div ref={ref} className={cn(badgeVariants({ variant }), className)} {...props} />33 )34 }35)36Badge.displayName = "Badge"3738export { Badge, badgeVariants }
What it pulls in
npm packages
Other registry items
More from neobrutalui
All 24 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | neobrutalui | Components | Free | 2 deps | |
| alertalert | neobrutalui | Components | Free | 1 dep | |
| avataravatar | neobrutalui | Components | Free | no deps | |
| buttonbutton | neobrutalui | Components | Free | 1 dep | |
| cardcard | neobrutalui | Components | Free | no deps | |
| checkboxcheckbox | neobrutalui | Components | Free | 2 deps | |
| date-pickerdate-picker | neobrutalui | Components | Free | 2 deps | |
| dialogdialog | neobrutalui | Components | Free | 2 deps |
