# P badge 20

> Removable badge

A shadcn/ui block from the [@coss](https://coss.com/ui) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/coss/p-badge-20).

- Page, with a live preview: https://shadcn.exchange/r/coss/p-badge-20
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/coss/p-badge-20-light-242db550313124da.png
- Registry item: https://coss.com/ui/r/p-badge-20.json
- Categories: badge
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://coss.com/ui/r/p-badge-20.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- npm packages: `lucide-react`
- Registry items: `@coss/badge`

## Files

### `registry/default/particles/p-badge-20.tsx`

```tsx
"use client";

import { XIcon } from "lucide-react";
import { useState } from "react";
import { Badge } from "@/registry/default/ui/badge";

export default function Particle() {
  const [isActive, setIsActive] = useState(true);

  if (!isActive) return null;

  return (
    <Badge className="gap-0">
      Removable
      <button
        className="-my-px -ms-px -me-1.5 inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-[inherit] p-0 text-primary-foreground/60 outline-none transition-[color,box-shadow] hover:text-primary-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"
        onClick={() => setIsActive(false)}
        type="button"
      >
        <XIcon aria-hidden="true" />
      </button>
    </Badge>
  );
}
```
