Skip to main content

Per-column filter row ("dual filter")

Prop enableColumnFilterRow — engine behaviour, default false.

Guide

When to use it

Let users filter each column from a dedicated input row under the headers — the "dual filter" layout, on top of (or instead of) the global search box.

How it works

It adds a second header row of per-column filter inputs. It's also the host for the richer filter widgets: enableSetFilter (a checklist of values) and enableMultiFilter (stacked filter types) render into this row.

Gotchas

  • Requires enableColumnFilters — it's the UI for that engine behaviour and a no-op without it.
  • It's always available in the settings sheet ("Columns"), so an end-user can switch it on themselves.

Live example

Per-column filter row — an input under each header

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' },
]
export default function App() {
return (
<BstTableMui data={seed} columns={columns} getRowId={(r) => r.id}
enableColumnFilters enableColumnFilterRow showSearch={false} />
)
}
Loading live example…

Overview

Layerenable* (engine, resolved in useBstTable)
Typeboolean
Defaultfalse
Maps toengine header row (needs enableColumnFilters). Always shown in the settings sheet ("Columns", alwaysShow) so end-users can switch it on themselves
Status✅ done (Phase 3; always-in-settings v0.29.0)
Sincev0.9.0
Settings sheetColumns

Render a per-column filter row under the header (the "dual filter" — works alongside the filter-builder panel; both drive columnFilters). Each column gets a type-appropriate control (text/number/date input, select dropdown, boolean tri-state). Needs enableColumnFilters. Default: false.

Enable it

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

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

Behavior & interactions

  • Requires enableColumnFilters to be on — this flag is a no-op otherwise.