Filtered Table Pattern
A toolbar with faceted filters and table actions above a data table.
Made by eblairmckeeA toolbar with DataTableFilter on the left and table actions on the right, positioned gap-4 above the table.
Loading component...
Toolbar Layout
┌──────────────────────────────────────────────────────────────────┐
│ [+ Filter ▼] [Status: is Running ✕] [↻] [⋮ Columns] │
├──────────────────────────────────────────────────────────────────┤
│ Name │ Status │ Nodes │ Region │ Actions │
│ ... │ ... │ ... │ ... │ ... │
└──────────────────────────────────────────────────────────────────┘Left side (filters):
- DataTableFilter with faceted counts from TanStack Table
- Active filter pills with operator display and clear actions
Right side (table actions):
- Refresh button
- Column visibility toggle
- Other table-level actions (export, bulk actions, etc.)
Components Used
| Component | Purpose |
|---|---|
| DataTableFilter | Faceted filter bar with operator support |
| Data Table | TanStack Table-based data grid |
| Button | Toolbar action buttons |
| DropdownMenu | Column visibility toggle |
Best Practices
- Consistent spacing - Use
gap-4between toolbar and table - Logical filter order - Order filter columns by frequency of use
- Icon buttons for actions - Use icon-only buttons for refresh and column toggle
- Right-align row actions - Keep action menus in the last column, right-aligned
- Column visibility - Allow users to hide/show columns for dense tables
- Faceted counts - Enable
getFacetedRowModel()andgetFacetedUniqueValues()on the table for live filter counts
Built by malinskibeniamin. The source code is available on GitHub.