Chip Group
Selectable chip pills for filtering and tagging. Supports single or multi-select, size/color/variant combinations, count badges, removable chips, icons, and disabled options.
Quick Preview
Selected: all
Installation
// Copy fromsrc/components/ui/ChipGroup.tsx
Usage
'use client'import { useState } from 'react'import { ChipGroup } from '@/components/ui/ChipGroup'// Single-selectexport function FilterBar() {const [filter, setFilter] = useState<string | undefined>('all')return (<ChipGroupoptions={[{ value: 'all', label: 'All' },{ value: 'react', label: 'React' },{ value: 'vue', label: 'Vue' },{ value: 'svelte',label: 'Svelte' },]}value={filter}onChange={setFilter}/>)}// Multi-selectexport function TagPicker() {const [tags, setTags] = useState<string[]>([])return (<ChipGroupmultioptions={[{ value: 'ts', label: 'TypeScript', icon: '๐ท' },{ value: 'react', label: 'React', icon: 'โ๏ธ' },{ value: 'next', label: 'Next.js', icon: 'โฒ' },]}value={tags}onChange={setTags}/>)}
Examples
Single-select (default)
Click a chip to select it; click again to deselect.
selected: all
Multi-select
Pass multi prop to allow multiple selections.
selected: [ui, forms]
With icons
Add an icon string or emoji to each option.
selected: [ts, react]
Size variants
size="sm" | "md" | "lg"
Color variants
color="primary" | "blue" | "violet" | "orange"
Visual variant
variant="filled" | "outline" | "soft"
With count badge
showCount displays a small badge with the option count.
Removable chips
removable allows deselecting via an ร button on selected chips.
selected: [css, ts]
Disabled chips
Pass disabled: true on individual options.
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
options* | ChipOption[] | - | Array of selectable chip items |
multi | boolean | - | Enable multi-selection; omit or false for single-select |
value | string | string[] | - | Controlled selected value(s) |
defaultValue | string | string[] | - | Uncontrolled initial selection |
onChange | (value: string | string[] | undefined) => void | - | Fires on selection change |
size | 'sm' | 'md' | 'lg' | 'md' | Chip size |
variant | 'filled' | 'outline' | 'soft' | 'filled' | Visual style |
color | 'primary' | 'gray' | 'blue' | 'violet' | 'orange' | 'primary' | Active color theme |
showCount | boolean | false | Show count badge per chip |
removable | boolean | false | Show ร to deselect on selected chips |
className | string | - | Additional CSS classes for the wrapper |