- Fix focus ring in Select
- Dark mode for Code Diff
Installation
$ pnpm dlx shadcn@latest add @synccn/filter-chipsFirst time in this project? Connect synccn with one command.
Usage
import { FilterChips } from "@/components/ui/filter-chips";<FilterChips options={statuses} />API reference
Generated from the component's TypeScript types, so it always matches the code.
FilterChips
Toggleable filter pills with counts and a "Clear" action. options: [{ value, label, count?, icon? }]
PropTypeDescription
- optionsrequired
{ value: string; label: React.ReactNode; count?: number; icon?: React.ElementType }[]Filters.
- value
string[]Controlled selection.
- defaultValue
string[]Default
[]Initial selection when uncontrolled.
- onValueChange
(value: string[]) => voidCalled with the new selection.
- multiple
booleanDefault
trueAllow several filters at once.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for Check, X
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA roles: group
- ARIA attributes: aria-pressed
- Shows a visible focus ring for keyboard users
More inputs
ButtonSeven variants, four sizes and a built-in loading state.InputText field with optional leading icon and invalid state.TextareaMulti-line field that grows with its content and counts characters.CheckboxChecked, unchecked and indeterminate, with label and description.SwitchToggle with a springy thumb in three sizes.Radio GroupPick one option, shown as dots or as selectable cards.