# Removable

> Dismissible tag chips with a trailing remove button.

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

- Page, with a live preview: https://shadcn.exchange/r/flx/badge-08
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/flx/badge-08-light-403eecc2d90dc3bc.png
- Registry item: https://ui.flexnative.com/r/badge-08.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.flexnative.com/r/badge-08.json
```

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

## Dependencies

- Registry items: `badge`

## Files

### `registry/patterns/badge/badge-08.tsx`

```tsx
'use client'

import { useState } from 'react'
import { XIcon } from 'lucide-react'

import { Badge } from '@/components/ui/badge'

const initialTags = ['Design', 'Engineering', 'Marketing', 'Sales']

export function Badge08() {
  const [tags, setTags] = useState(initialTags)

  return (
    <div className="flex flex-wrap items-center gap-2">
      {tags.map((tag) => (
        <Badge key={tag} variant="secondary">
          {tag}
          <button
            type="button"
            onClick={() => setTags((prev) => prev.filter((t) => t !== tag))}
            aria-label={`Remove ${tag}`}
            className="data-[icon=inline-end]:-mr-0.5 rounded-full opacity-60 transition-opacity hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"
            data-icon="inline-end"
          >
            <XIcon className="size-3" />
          </button>
        </Badge>
      ))}
      {tags.length === 0 && (
        <button
          type="button"
          onClick={() => setTags(initialTags)}
          className="text-muted-foreground text-xs underline-offset-4 hover:underline"
        >
          Reset
        </button>
      )}
    </div>
  )
}
```
