Tag Select
manifest-ui/tag-selectFreeBlock
Colored tag selector with single or multiple selection and color variants.
Install it
npx shadcn@latest add https://ui.manifest.build/r/tag-select.jsonSource
1'use client'23import { Button } from '@/components/ui/button'4import { cn } from '@/lib/utils'5import { Check, X } from 'lucide-react'6import { useEffect, useState } from 'react'7import { demoTags } from './demo/selection'89/**10 * Represents an individual tag option.11 * @interface Tag12 * @property {string} id - Unique identifier for the tag13 * @property {string} label - Display text for the tag14 * @property {"default" | "blue" | "green" | "red" | "yellow" | "purple"} [color] - Optional color theme15 */16export interface Tag {17 id?: string18 label?: string19 color?: 'default' | 'blue' | 'green' | 'red' | 'yellow' | 'purple'20}2122/**23 * ═══════════════════════════════════════════════════════════════════════════24 * TagSelectProps25 * ═══════════════════════════════════════════════════════════════════════════26 *27 * Props for the TagSelect component, which provides tag-based filtering with28 * single or multiple selection modes and validation support.29 */30export interface TagSelectProps {31 data?: {32 /** Array of tags to display for selection. */33 tags?: Tag[]34 }35 actions?: {36 /** Called when the user clicks the validate button with the selected tag IDs. */37 onValidate?: (tagIds: string[]) => void38 }39 appearance?: {40 /**41 * Selection mode: single allows one tag, multiple allows many.42 * @default "multiple"43 */44 mode?: 'single' | 'multiple'45 /**46 * Whether to show the clear selection button.47 * @default true48 */49 showClear?: boolean50 /**51 * Whether to show the validate button.52 * @default true53 */54 showValidate?: boolean55 /**56 * Custom label for the validate button.57 * @default "Validate selection"58 */59 validateLabel?: string60 }61 control?: {62 /** Array of pre-selected tag IDs for controlled mode. */63 selectedTagIds?: string[]64 }65}666768// ChatGPT-compliant: all tags use neutral system colors69const tagClasses = {70 selected: 'bg-foreground text-background border-foreground',71 unselected: 'bg-background text-foreground border-border hover:bg-muted'72}7374/**75 * A tag selection component with single or multiple selection modes.76// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from Manifest UI
All 32 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Amount Inputamount-input | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Chat Conversationchat-conversation | Manifest UI | Blocks | Free | 1 dep · 3 files | |
| Contact Formcontact-form | Manifest UI | Blocks | Free | 1 dep · 3 files | |
| Date & Time Pickerdate-time-picker | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Cardevent-card | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Confirmationevent-confirmation | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Detailevent-detail | Manifest UI | Blocks | Free | 3 deps · 2 files | |
| Event Listevent-list | Manifest UI | Blocks | Free | 3 deps · 2 files |
