Usage
Table plugin that adds inline column filters with popover or inline controls. T is the row type; TypeScript cannot infer it from the config, so it defaults to Record<string, unknown>, which a Table with typed rows rejects: pass it, as in useTableFiltering<Walk>(…) for <Table<Walk>>. Pairs with useTableFilterState for managed state. Supports text, select, multi-select, date, and number filter types via PowerSearch field definitions. The plugin renders the filter controls only; it does not remove rows. Filter the data yourself (toSearchFilters with applyFilters from usePowerSearchConfig) and pass the result to Table. When no row matches, Table shows its emptyState prop.
tsimport {useTableFiltering} from '@astryxdesign/core/Table'
Parameters
| Param | Type | Description |
|---|---|---|
filtersrequired | Current filter state: map from column key to filter value. | |
onFilterChangerequired | (columnKey: string, value: | null) => void | Called when the user changes a filter value. null clears the filter. |
variant | 'popover' | 'inline' | 'inline-compact' (default: 'popover') | Display variant for filter controls. |
searchConfigrequired | Defines the filter fields. A column sets |
Examples
Common configurations, variations, and states.Table with inline filter controls rendered directly below each column header.
Table with popover filter controls triggered by icons in column headers.
Use with shadcn
Already using the shadcn registry workflow? Install the real Astryx package and a local public re-export. Component implementation source stays in Astryx.
This install URL expires with the draft preview.bashnpx shadcn@4.19.0 add https://astryx-11q8a6st7-fbopensource.vercel.app/shadcn/hooks/use-table-filtering.json