Chip Filter

Single select filter chips in React that behave as a radio group, with an accent ring on the active chip. Good for quick filters above lists and tables.

src/registry/ui/chip-filter.tsx/r/chip-filter.json

Installation#

bash
npx shadcn@latest add @minidev/chip-filter

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/chip-filter.json

Usage#

tsx
import { ChipFilter } from "@/components/ui/chip-filter"

export function Example() {
  return (
    <ChipFilter value={chip} onChange={setChip} options={[{ value: "all", label: "All" }, { value: "mine", label: "Mine" }, { value: "open", label: "Open" }]} />
  )
}

API reference#

ChipFilter props
PropTypeDefault
optionsChipOption[]SAMPLE_OPTIONS
valuestring-
defaultValuestring"all"
onChange(value: string) => void-
classNamestring-

Examples#

All form components

Learn more