Badge
boldkit/badgeFreeComponent
Displays a badge or a component that looks like a badge with neubrutalism styling
Live preview
live · rendered by the registry
Rendered by boldkit on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://boldkit.dev/r/badge.jsonSource
1/* eslint-disable react-refresh/only-export-components */2import * as React from 'react'3import { cva, type VariantProps } from 'class-variance-authority'4import { cn } from '@/lib/utils'56const badgeVariants = cva(7 'inline-flex items-center border-2 border-foreground px-2.5 py-0.5 text-xs font-bold uppercase tracking-wide transition duration-200 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 shadow-[4px_4px_0px_hsl(var(--shadow-color))] hover:translate-x-[4px] hover:translate-y-[4px] hover:shadow-none',8 {9 variants: {10 variant: {11 default: 'bg-primary text-primary-foreground',12 secondary: 'bg-secondary text-secondary-foreground',13 accent: 'bg-accent text-accent-foreground',14 destructive: 'bg-destructive text-destructive-foreground',15 success: 'bg-success text-success-foreground',16 warning: 'bg-warning text-warning-foreground',17 info: 'bg-info text-info-foreground',18 outline: 'bg-background text-foreground',19 },20 },21 defaultVariants: {22 variant: 'default',23 },24 }25)2627export interface BadgeProps28 extends React.HTMLAttributes<HTMLSpanElement>,29 VariantProps<typeof badgeVariants> {}3031function Badge({ className, variant, ...props }: BadgeProps) {32 return (33 <span34 className={cn(badgeVariants({ variant }), className)}35 {...props}36 />37 )38}3940export { Badge, badgeVariants }
What it pulls in
npm packages
Other registry items
Files it writes
More from boldkit
All 94 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | boldkit | Components | Free | 2 deps | |
| Alertalert | boldkit | Components | Free | 2 deps | |
| Alert Dialogalert-dialog | boldkit | Components | Free | 1 dep | |
| ASCII Shapesascii-shapes | boldkit | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | boldkit | Components | Free | 1 dep | |
| Avataravatar | boldkit | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | boldkit | Components | Free | 2 deps | |
| Buttonbutton | boldkit | Components | Free | 2 deps |
