Removable
flx/badge-08FreeBlock
Dismissible tag chips with a trailing remove button.
Install it
npx shadcn@latest add https://ui.flexnative.com/r/badge-08.jsonSource
1'use client'23import { useState } from 'react'4import { XIcon } from 'lucide-react'56import { Badge } from '@/components/ui/badge'78const initialTags = ['Design', 'Engineering', 'Marketing', 'Sales']910export function Badge08() {11 const [tags, setTags] = useState(initialTags)1213 return (14 <div className="flex flex-wrap items-center gap-2">15 {tags.map((tag) => (16 <Badge key={tag} variant="secondary">17 {tag}18 <button19 type="button"20 onClick={() => setTags((prev) => prev.filter((t) => t !== tag))}21 aria-label={`Remove ${tag}`}22 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"23 data-icon="inline-end"24 >25 <XIcon className="size-3" />26 </button>27 </Badge>28 ))}29 {tags.length === 0 && (30 <button31 type="button"32 onClick={() => setTags(initialTags)}33 className="text-muted-foreground text-xs underline-offset-4 hover:underline"34 >35 Reset36 </button>37 )}38 </div>39 )40}
What it pulls in
Other registry items
Files it writes
More from flx
All 450 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Basicaccordion-01 | flx | Blocks | Free | no deps | |
| Multipleaccordion-02 | flx | Blocks | Free | no deps | |
| With iconsaccordion-03 | flx | Blocks | Free | no deps | |
| FAQaccordion-04 | flx | Blocks | Free | no deps | |
| Separated cardsaccordion-05 | flx | Blocks | Free | no deps | |
| Plus / minus iconaccordion-06 | flx | Blocks | Free | 1 dep | |
| Left chevronaccordion-07 | flx | Blocks | Free | 1 dep | |
| Rich contentaccordion-09 | flx | Blocks | Free | no deps |
