---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Filter chips

The row of filters applied to a list, under its search field or filter controls, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `FilterChips`.

## When to use

- The row of filters applied to a list, under its search field or filter controls.
- Also called: filter pills.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Filter chips on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-filter-chips.json --yes
```

```text
Add the Goop Filter chips to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { useRef, useState } from 'react';
import { FilterChip, FilterChips } from '@/components/ui/goop/filter-chips';
import { SearchInput } from '@/components/ui/goop/search-input';

const START = [
  { field: 'Status', value: 'In progress' },
  { field: 'Owner', value: 'Anh Trinh' },
  { field: 'Label', value: 'Design' },
];

function TaskFilters() {
  const search = useRef<HTMLInputElement | null>(null);
  const [filters, setFilters] = useState(START);
  return (
    <div className="flex flex-col gap-3">
      <SearchInput ref={search} label="Search tasks" placeholder="Search tasks" />
      <FilterChips onClearAll={() => setFilters([])} returnFocus={search}>
        {filters.map((filter) => (
          <FilterChip
            key={filter.field}
            field={filter.field}
            onRemove={() => setFilters((now) => now.filter((other) => other.field !== filter.field))}
          >
            {filter.value}
          </FilterChip>
        ))}
      </FilterChips>
    </div>
  );
}
```

- Fits: list, board: toolbar.
- Also known as: ActiveFilters, AppliedFilters, FilterBar, FilterTags, DismissibleTag.
- Under a list's search field or filter controls, on a line of its own, show each filter in force as a FilterChip with Clear all, so the person sees and undoes what narrowed the list; a status is a Badge, never a chip.
- height, width, padding, gap, corner, background, text, motion: add no class for these.

## API reference

### Options

- `aria-label?: string = 'Active filters'` — The row's name, read as the group's; `Active filters` by default.
- `onClearAll?: () => void` — Takes every filter off.
- `clearLabel?: string = 'Clear all'` — The "Clear all" button's words; `Clear all` by default.
- `returnFocus?: RefObject<HTMLElement | null>` — Where the focus goes when no chip is left (after the last cross or "Clear all"): the caller's first filter control.
- `removedMessage?: (words: string) => string` — What the status line says after a cross is pressed, from the chip's words; `<words> removed` by default.
- `clearedMessage?: string = 'All filters cleared'` — What the status line says after "Clear all"; `All filters cleared` by default.
- `disabled?: boolean = false` — Every chip shown but none can be taken off: no cross, no "Clear all", the chips dimmed.
- `children?: ReactNode` — The chips: one `FilterChip` per filter in force (each may sit inside its own editor's `DropdownMenu`).

### Parts

- `FilterChip` — One filter in force, in a `FilterChips` row; its props: filter-chips--filter-chip.md

- data-slot values (to select a part by): filter-chip, filter-chip-close, filter-chip-content, filter-chip-indicator, filter-chip-label, filter-chip-trigger, filter-chip-value, filter-chips, filter-chips-action, filter-chips-status

### FilterChip

One filter in force, in a `FilterChips` row.

```tsx
import { FilterChip } from '@/components/ui/goop/filter-chips';
```

### Options

- field?: ReactNode — What the filter narrows, before its value: `Status`.
- children: ReactNode — The filter's value: `In progress`.
- onRemove?: () => void — Takes this filter off (the caller's state drops it, and the chip with it).
- removeLabel?: string — The cross's spoken name; `Remove filter <field>: <value>` by default.
- onEdit?: () => void — Makes the chip's words a button that opens the caller's own editor for this filter (a sheet, a dialog).
- editAs?: ReactElement<{ asChild?: boolean; children?: ReactNode }> — Makes the chip's words the trigger of the caller's editor: a `DropdownMenuTrigger` or `PopoverTrigger` element, handed the words' button through `asChild`; the chip then sits inside that menu's or popover's root.
- disabled?: boolean = false — Shown but not changeable: dimmed, no cross, its words no button.

## Keyboard

- Tab: move to each chip's words (when they edit), its cross, then Clear all
- Enter / Space on a cross: take that filter off; the focus moves to the next chip, else the previous, else the caller's filter control
- Enter / Space on Clear all: take every filter off; the focus moves to the caller's filter control
- Enter / Space on an editable chip's words: open the caller's editor for that filter

## Accessibility

- The native element answers the keyboard.
- hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing
- expanded: the attribute data-state=open
- open: the attribute data-state=open
- disabled: the prop disabled

## Motion

- The part sets its own motion: add no transition or animation of your own.

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

## Related

- [Search input](/themes/meadow/components/search-input): A search field with the magnifier at its start, for narrowing a list or a page.
- [Tree view](/themes/meadow/components/tree-view): Nested rows a person opens and closes, to pick one (or several) of them.
- [Steps](/themes/meadow/components/steps): A strip that shows which step of a flow the user is on, for display only.
- [Navigation menu](/themes/meadow/components/navigation-menu): A site's header menu.
