Badge
bundui/badge-with-dismissFreeComponent
Displays a badge or status indicator.
Live preview
live · rendered by the registry
Rendered by bundui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://bundui.io/r/badge-with-dismiss.jsonSource
1"use client";23import { useState } from "react";4import { Badge } from "@/components/ui/badge";5import { XIcon } from "lucide-react";67export default function BadgeWithDismiss() {8 const [badges, setBadges] = useState([9 { id: 1, label: "Next.js" },10 { id: 2, label: "Tailwind CSS" },11 { id: 3, label: "Laravel" }12 ]);1314 function removeBadge(id: number) {15 setBadges((prev) => prev.filter((badge) => badge.id !== id));16 }1718 return (19 <div className="flex items-center justify-center gap-2">20 {badges.map(({ id, label }) => (21 <Badge22 key={id}23 variant="secondary"24 className="flex cursor-pointer items-center gap-1 hover:opacity-80"25 onClick={() => removeBadge(id)}>26 {label}27 <XIcon className="size-3" />28 </Badge>29 ))}30 </div>31 );32}
What it pulls in
npm packages
Other registry items
Files it writes
More from bundui
All 217 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion-collapsible | bundui | Components | Free | no deps · 2 files | |
| Accordionaccordion-default | bundui | Components | Free | no deps | |
| Accordionaccordion-with-plus-icon | bundui | Components | Free | 2 deps | |
| Alertalert-danger | bundui | Components | Free | 1 dep | |
| Alertalert-default | bundui | Components | Free | no deps | |
| Alert Dialogalert-dialog | bundui | Components | Free | no deps | |
| Alertalert-success | bundui | Components | Free | 1 dep | |
| Alertalert-warning | bundui | Components | Free | 1 dep |
