For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
Shadcn Labs/

Filter Grid

Filter a grid with chips and search. Matches reflow into place, the rest pop out, and new items pop in one after another. A React component built on View Transitions, installed with the shadcn CLI.

  • Brand refresh

    Design

  • Public API v2

    Engineering

  • Pricing page

    Product

  • Icon set

    Design

  • Offline sync

    Engineering

  • Onboarding flow

    Product · Design

  • Design tokens

    Design · Engineering

  • Search index

    Engineering

  • Q3 roadmap

    Product

  • Motion guide

    Design

  • Faster CI

    Engineering

  • User interviews

    Product

Showing 12 of 12

Installation

$ pnpm dlx shadcn@latest add @transition-kit/filter-grid

Usage

import {
  FILTER_ALL,
  FilterGrid,
  FilterGridFilter,
  FilterGridFilters,
  FilterGridItems,
  FilterGridSearch,
} from "@/components/transitions/filter-grid";
const projects = [
  { id: "brand", title: "Brand refresh", tags: ["Design"] },
  { id: "api", title: "Public API v2", tags: ["Engineering"] },
  { id: "pricing", title: "Pricing page", tags: ["Product"] },
];
 
<FilterGrid items={projects}>
  <FilterGridFilters aria-label="Team">
    <FilterGridFilter value={FILTER_ALL}>All</FilterGridFilter>
    <FilterGridFilter value="Design">Design</FilterGridFilter>
    <FilterGridFilter value="Engineering">Engineering</FilterGridFilter>
    <FilterGridFilter value="Product">Product</FilterGridFilter>
  </FilterGridFilters>
  <FilterGridSearch placeholder="Search projects…" />
  <FilterGridItems<(typeof projects)[number]>>
    {(project) => <div className="rounded-lg border p-4">{project.title}</div>}
  </FilterGridItems>
</FilterGrid>;
const [team, setTeam] = useState("all");
 
<FilterGrid items={projects} filter={team} onFilterChange={setTeam}>
  …
</FilterGrid>;

API Reference

FilterGrid

PropTypeDefaultDescription
items{ id: string | number; tags: string[] }[]-Full item list, each with an id and tags.
filterstring-Controlled active filter value.
defaultFilterstring"all"Initial filter when uncontrolled.
onFilterChange(filter: string) => void-Called with the new filter after selection.
querystring-Controlled search text.
defaultQuerystring""Initial search text when uncontrolled.
onQueryChange(query: string) => void-Called with the new query after typing settles.
match(item: T, query: string) => booleanwords in string fields, tagsTests an item against the query.
status(shown: number, total: number) => string"Showing 4 of 12"Live-region message built from the shown and total counts.

FilterGridFilter

PropTypeDefaultDescription
valuestring-Filter value selected by this chip.

FilterGridSearch

PropTypeDefaultDescription
debouncenumber150Milliseconds of idle typing before the grid filters.

FilterGridItems

PropTypeDefaultDescription
children(item: T, index: number) => ReactNode-Renders each visible item.
emptyReactNode"Nothing matches."Shown when no item matches the filter and search.
reserveSpacebooleantrueKeeps the unfiltered grid height so the page never jumps.