Skip to content

Patterns

Data management

People look for a few rows in a long list, act on one of them, or create a new one. They need to narrow the list quickly, see how many rows are left, open a row's detail, and understand when the data is loading, missing or failed.

Reference build

Live, built only from system components. Switch the width: the build uses its own breakpoints.

Rules

  1. PageHead size="md" carries the title and the one action that creates a new item; actions on a single item live on its detail page.
  2. The toolbar holds the search field first, then FilterChips; the table keeps its caption.
  3. Filter as people type or click, without a submit button; no chip selected means no restriction.
  4. Show the number of results in a live region (role=status) right above the table, so screen readers hear it.
  5. When nothing matches, replace the table with EmptyState: say what was searched and offer “Clear filters”. When nothing exists yet, EmptyState offers the create action instead.
  6. Loading and failure follow the Async states pattern, below the toolbar, which stays usable.
  7. Group or sort the table as without filters; filters only remove rows, they never reorder them.
  8. Link each row through its name when it has a detail page (rowLink); never make whole rows clickable.
  9. Long lists people scan (logs, many records) use Table density="compact". Work on several rows at once uses selectable with bulkActions; the bar names the count, a destructive bulk action asks first.

Layout and states

What every build of this pattern must hold to. The check runs the required states on the reference build.
Layout
Inside AppShell: PageHead, then the list region. The list region stacks with gap-stack-relaxed: toolbar (search and chips side by side from md), result count, then the table or a state.
Small screens: scroll
Search and chips stack; the table keeps its columns and scrolls inside its own region.
Required states
StateProves
filteredA filter reduces the rows and the count says how many are left.
no-resultsA search with no match replaces the table with EmptyState and a clear action.
sortedA sortable column reorders the rows.

Code

src/patterns/data-management/Example.tsx
"use client";

// Client component: it holds the filter state. Client components import from src/ds by path (CLAUDE.md).
import { useState } from "react";
import { Button } from "@/ds/Button/Button";
import { EmptyState } from "@/ds/EmptyState/EmptyState";
import { FilterChips } from "@/ds/FilterChips/FilterChips";
import { Input } from "@/ds/Input/Input";
import { PageHead } from "@/ds/PageHead/PageHead";
import { Table } from "@/ds/Table/Table";

const projects = [
  {
    project: "Ayvens",
    work: "Rebranding while running — car configurator through a brand merger",
    start: "2025",
    decade: "2020s",
    kind: "case",
    href: "https://www.free-lenz.net/case/ayvens",
  },
  { project: "Mitsubishi Electric", work: "Evolving the Aircon product line", start: "2022", decade: "2020s", kind: "project", href: "" },
  {
    project: "LVM Versicherung",
    work: "Design system & token architecture — cross-line contract management",
    start: "2021",
    decade: "2020s",
    kind: "case",
    href: "https://www.free-lenz.net/case/lvm",
  },
  { project: "OTTO", work: "Relaunch of the OTTO app", start: "2020", decade: "2020s", kind: "project", href: "" },
  { project: "StepStone", work: "Evolution of the job portal", start: "2020", decade: "2020s", kind: "project", href: "" },
  {
    project: "Deutsche Bahn",
    work: "Mobile UX & interaction design — Quick Booking in DB Navigator",
    start: "2017",
    decade: "2010s",
    kind: "case",
    href: "https://www.free-lenz.net/case/db-navigator",
  },
  { project: "Mercedes Pay", work: "Digital payment service", start: "2017", decade: "2010s", kind: "project", href: "" },
  { project: "JUKE", work: "Streaming app for movies & series", start: "2015", decade: "2010s", kind: "project", href: "" },
  { project: "Lovoo", work: "Dating-app relaunch", start: "2015", decade: "2010s", kind: "project", href: "" },
  {
    project: "MediaMarkt",
    work: "Design system for two brands across 11 countries",
    start: "2014",
    decade: "2010s",
    kind: "case",
    href: "https://www.free-lenz.net/case/mediamarkt",
  },
  { project: "BAUR", work: "Relaunch support for baur.de", start: "2013", decade: "2010s", kind: "project", href: "" },
  { project: "iLandGuide", work: "Own startup: a tourism franchising app", start: "2011", decade: "2010s", kind: "project", href: "" },
  { project: "Deutsche Telekom", work: "Interaction & showcase design, CeBIT", start: "2010", decade: "2010s", kind: "project", href: "" },
];

export function Example() {
  const [query, setQuery] = useState("");
  const [kinds, setKinds] = useState<string[]>([]);

  const needle = query.trim().toLowerCase();
  const rows = projects.filter(
    (row) =>
      (kinds.length === 0 || kinds.includes(row.kind)) && (needle === "" || `${row.project} ${row.work}`.toLowerCase().includes(needle)),
  );
  const clear = () => {
    setQuery("");
    setKinds([]);
  };

  return (
    // Inside AppShell the shell spaces head and list region; here the build does it itself.
    <div className="flex flex-col gap-region">
      {/* On a screen: as="h1" (the build sits under the docs page's own headings). */}
      <PageHead as="h2" size="md" title="Projects" actions={<Button>Add project</Button>} />
      <div className="flex flex-col gap-stack-relaxed">
        <div className="flex flex-col gap-stack md:flex-row md:items-end md:justify-between">
          <Input
            label="Search projects"
            type="search"
            name="project-search"
            value={query}
            onChange={(event) => setQuery(event.target.value)}
          />
          <FilterChips
            label="Show"
            selected={kinds}
            onChange={setKinds}
            options={[
              { value: "case", label: "Featured cases" },
              { value: "project", label: "Projects" },
            ]}
          />
        </div>
        <p role="status" className="text-small text-secondary">
          {rows.length === projects.length ? `All ${rows.length} projects` : `${rows.length} of ${projects.length} projects`}
        </p>
        {rows.length > 0 ? (
          <Table
            caption="Projects by decade"
            rowKey="project"
            groupBy="decade"
            rowLink="href"
            columns={[
              { key: "project", header: "Project" },
              { key: "work", header: "Work" },
              { key: "start", header: "Start", sortable: true, firstDirection: "descending" },
            ]}
            rows={rows}
          />
        ) : (
          <EmptyState
            title={needle ? `No projects match “${query.trim()}”` : "No projects match these filters"}
            action={
              <Button variant="secondary" onClick={clear}>
                Clear filters
              </Button>
            }
          >
            Try another word, or clear the filters to see all projects.
          </EmptyState>
        )}
      </div>
    </div>
  );
}

Built from

Seen in: CRM organisations table (S3); round 5 requests-inbox (2026-11-13).