Pixelact Badge
pixelact-ui/badgeFreeComponent
A simple badge component.
Live preview
live · rendered by the registry
Rendered by Pixelact UI on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://pixelactui.com/r/badge.jsonSource
1import { type VariantProps, cva } from "class-variance-authority";2import { cn } from "@/lib/utils";3import { Badge as ShadcnBadge } from "@/components/ui/badge";45const badgeVariants = cva("border-none", {6 variants: {7 font: {8 normal: "",9 pixel: "pixel-font",10 },11 variant: {12 default: "bg-primary",13 destructive: "bg-destructive",14 outline: "bg-background",15 secondary: "bg-secondary",16 },17 },18 defaultVariants: {19 font: "pixel",20 variant: "default",21 },22});2324export interface BadgeProps25 extends React.ButtonHTMLAttributes<HTMLButtonElement>,26 VariantProps<typeof badgeVariants> {27 asChild?: boolean;28}2930function Badge({ children, font, variant, ...props }: BadgeProps) {31 return (32 <div className={cn("relative inline-flex")}>33 <ShadcnBadge34 {...props}35 className={cn(36 "rounded-none shadow-(--pixel-box-shadow) box-shadow-margin",37 badgeVariants({ variant, font })38 )}39 variant={variant}40 >41 {children}42 </ShadcnBadge>43 </div>44 );45}4647export { Badge };
What it pulls in
Other registry items
Files it writes
More from Pixelact UI
All 28 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Pixelact Accordionaccordion | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Alertalert | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Alert Dialogalert-dialog | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Avataravatar | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Breadcrumbbreadcrumb | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Buttonbutton | Pixelact UI | Components | Free | no deps · 3 files | |
| Pixelact Calendarcalendar | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Cardcard | Pixelact UI | Components | Free | no deps · 2 files |
