AdaptTable for Base UI

Filtering in Base UI

Declare what a column filters by and the table builds the control: text and number operators, date ranges with relative presets, and a checklist of the values actually present.

For the cases one row of inputs cannot express there is an AND/OR tree, and every active filter shows as a chip that removes itself. Quick find is a different control — it highlights matching cells and writes find= into the same URL namespace; it does not replace the filter tree.

Filter state and the find query both live in the versioned URL, so a filtered-and-found view is a link someone can send — and the popover, drawer, inputs, chips and find field are all Base UI components.

The popover shifts rather than flips — the form grows when an operator takes a second bound, and flipping threw it over the page header — and the drawer is Base UI's, with its swipe direction mirrored for right-to-left.

The code

import { DataTable, type ColumnDef } from "@adapttable/base-ui";
import { filters } from "@adapttable/base-ui/filters";

const columns: ColumnDef<Person>[] = [
  { key: "name", filter: "text" },
  {
    key: "team",
    filter: { type: "select", options: "auto" },
  },
  { key: "budget", filter: "numberRange" },
  { key: "hiredAt", filter: "dateRange" },
];

export function People({ rows }) {
  return (
    <DataTable
      data={rows}
      columns={columns}
      rowKey={(row) => row.id}
      features={[filters([])]}
      filtersMode="popover"
      urlKey="f"
    />
  );
}

Install

pnpm add @adapttable/base-ui @adapttable/core @base-ui/react

The same feature in the other kits

More Base UI features

Reference: filtering, filter-tree, url-state. More of this kit: AdaptTable for Base UI, or the live demo.