Skip to content

Table: row filtering #168

Open
Open

Description

@coloneljade

Problem

The DataTable MVP (#161) shows all rows passed in. For tables of more than a few dozen rows, users need a way to narrow the visible set — search by free text, filter by column value, or both.

Impact

  • Without built-in filtering, consumers either pre-filter rows upstream (acceptable but pushes UI state into the consumer) or wire their own filter UI per use case (drift across apps).
  • Filter state in an editable table requires the same edit reconciliation work as sort — edits to a hidden row must persist when the filter changes.

Suggested Approach

Two complementary mechanisms:

interface IDataTableProps<T> {
  // controlled filter — parent decides which rows are visible
  filter?: (row: T) => boolean;
  // built-in free-text search across configured columns
  searchableColumns?: (keyof T)[];
  searchQuery?: string;
  onSearchQueryChange?: (query: string) => void;
}
  • filter: an arbitrary predicate the parent provides; DataTable uses it to determine which rows to render. Fully controlled.
  • searchableColumns + searchQuery: built-in free-text search box rendered in the toolbar that matches any of the listed columns case-insensitively. Optional convenience for the most common case; consumers wanting custom filter UI can use filter directly.
  • Hidden rows do not lose their underlying record identity — rowKey continues to track them; edits in flight survive filter changes.
  • Filter affects display only; onSave receives the full row set including filtered-out rows (consumer can reduce upstream if needed).

Context

Layered on top of #161 (DataTable MVP). Independent of sorting (#167) and pagination (#169).

Activity

  1. added this to the DataTable milestone on May 4, 2026
  2. added
    enhancement
    on May 4, 2026
  3. changed the title [-]DataTable: row filtering[/-] [+]Table: row filtering[/+] on May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions