Skip to main content

Multi-filter

Prop enableMultiFilter — engine behaviour, default false.

Guide

When to use it

When one column needs more than one kind of filter at once — say a text condition and a value checklist.

How it works

A column opts in with an array meta.filter (e.g. ['condition', 'set']); the parts render stacked in the filter row and a row must satisfy all of them (AND). It stores a compound { op: 'and', conditions } value.

Gotchas

  • Requires enableColumnFilters + enableColumnFilterRow; a 'set' part also needs enableSetFilter.
  • When off, an array meta.filter falls back to its first entry.

Live example

Multi-filter — stack a contains input and a checklist on one column

Example source
import React from 'react'
import { BstTableMui } from '@bloomskill/table-mui'
import type { BstTableColumn } from '@bloomskill/table-engine'
import '@bloomskill/table-engine/styles.css'
type Row = { id: string; name: string; team: string; role: string; score: number }
const seed: Row[] = [
{ id: '1', name: 'Ada Lovelace', team: 'Platform', role: 'Engineer', score: 92 },
{ id: '2', name: 'Alan Turing', team: 'Research', role: 'Scientist', score: 88 },
{ id: '3', name: 'Grace Hopper', team: 'Platform', role: 'Engineer', score: 95 },
{ id: '4', name: 'Katherine J.', team: 'Research', role: 'Analyst', score: 90 },
{ id: '5', name: 'Edsger Dijkstra', team: 'Platform', role: 'Architect', score: 84 },
]
const columns: BstTableColumn<Row>[] = [
{ id: 'name', accessorKey: 'name', header: 'Name' },
{ id: 'team', accessorKey: 'team', header: 'Team' },
{ id: 'role', accessorKey: 'role', header: 'Role' },
{ id: 'score', accessorKey: 'score', header: 'Score', sortFn: 'basic' },
]
const cols: BstTableColumn<Row>[] = columns.map((c) =>
c.id === 'name' ? { ...c, meta: { type: 'text', filter: ['condition', 'set'] } } : c)
export default function App() {
return (
<BstTableMui data={seed} columns={cols} getRowId={(r) => r.id}
enableColumnFilterRow enableSetFilter enableMultiFilter showSearch={false} />
)
}
Loading live example…

Overview

Layerenable* (engine, resolved in useBstTable)
Typeboolean
Defaultfalse
Maps tocustom — stack several filter types on one column. A column opts in with an array meta.filter (e.g. ['condition','set']), rendered stacked in its filter row; a row must satisfy all parts (AND). Stores a compound {op:'and',conditions} value the bstCondition filterFn understands (combineFilterConditions; FilterConditionGroup); BstSetFilter + the condition input each drive a positional slot. Needs enableColumnFilters + enableColumnFilterRow (a 'set' part needs enableSetFilter); when off, an array meta.filter falls back to its first entry. In settings ("Data operations", always shown). Both skins inherit it
Status✅ done
Sincev0.39.0
Settings sheetData operations

Multi-filter — stack several filter types on one column. A column opts in with meta.filter as an array (e.g. ['condition', 'set']), which renders the listed filters stacked in its filter row; a row must satisfy all of them (AND). Needs enableColumnFilters + enableColumnFilterRow (and enableSetFilter for a 'set' part). Default: false.

Enable it

<BstTableMui
data={rows}
columns={columns}
enableMultiFilter
/>

Swap BstTableMui for BstTableShadcn (and the CSS import) for the shadcn skin — same props.

Behavior & interactions

  • Requires enableColumnFilters, enableColumnFilterRow to be on — this flag is a no-op otherwise.
  • Multi-filter — stack several filter types on ONE column. Opt a column in with an ARRAY meta.filter, e.g. meta.filter: ["condition", "set"], which stacks those filters in its filter row; a row must satisfy all of them (AND). A "set" part also needs enableSetFilter. When off, an array meta.filter falls back to its first entry.