Search and filters
Combine search, column filters, and advanced AND/OR rules.
A table can offer a quick search, a small filter bar, and a filter menu with And / Or rules at the same time. Declare column types so the controls offer meaningful operators.
Configuration example
Start from the React quick start or Vue quick start. The following file extends their product catalog. Pass this configuration through getTableConfig in React or config in Vue.
import { defineTableConfig } from "@/components/ui/yayaw-table/config/helpers";
import { productConfig } from "./product-config";
export const filteringConfig = defineTableConfig({
...productConfig,
table: {
...productConfig.table,
enableColumnFilters: true,
enableAdvancedFilters: true,
showFilterBar: true,
filterBarColumns: ["status"],
showClearFilters: true,
searchDebounceMs: 250,
},
});import { defineTableConfig } from "@/components/ui/yayaw-table-vue/config";
import { productConfig } from "./product-config";
export const filteringConfig = defineTableConfig({
...productConfig,
table: {
...productConfig.table,
enableColumnFilters: true,
enableAdvancedFilters: true,
showFilterBar: true,
filterBarColumns: ["status"],
showClearFilters: true,
searchDebounceMs: 250,
},
});Choose the right control
Search handles free text. The optional filter bar highlights frequently used static-option, boolean or date columns. Column menus open the rule of their column. The filter menu, modelled on Notion's, adds typed rules and joins them with And / Or: with two or more rules, both editions offer “Match all conditions / any condition”, saved with views and in the URL. Disabling one control does not authorize the backend to ignore the filters that arrive.
The filter menu
Native filters are enabled by default; table.enableAdvancedFilters: false explicitly disables their editor. + Filter stays directly accessible in the filter row below the toolbar, including before the first rule is added, in React and Vue. It opens the searchable list of filterable columns. The same list remains available from the Filter screen of View settings. The badge of the View settings button counts the active filters and sorts that the default view (table.defaultView over the catalogue's defaults) does not already apply, so a table showing its default view has no badge. Picking a column adds a rule and opens its editor, and a column header's filter entry opens the rule of that column.
Property counts: the property picker shows the number of complete active rules beside each column, including pinned date periods. Inactive rules and incomplete drafts do not count. Multiple selected values in one rule count as one filter; a property without an active rule shows no count.
Empty state: without rules, + Filter remains available. Removing the last rule keeps this entry point visible.
Clear filters: when rules are shown in this row, a clear action beside their chips removes them together. Periods pinned to the toolbar or quick filter bar stay unchanged. The clear action disappears once the row has no rules to clear.
Chips: each rule shows as a chip under the toolbar ("Status is Active", "Due · Last 30 days"). A click on the chip changes the operator or the value, or deletes the rule. The operators follow the column type: text, number, date, select, multi-select, boolean, location and the file tree's folder.
Advanced filter: Add advanced filter shows the rules as one list joined with And or Or, as Notion does.
Typing: text and numbers filter once typing pauses (500 ms), on Enter or when the field is left; Escape restores the value that filters.
Incomplete rules: a rule without a value stays as a dashed chip and never reaches
list, the URL or a saved view.Labels: the menu has built-in English and French labels, chosen from the table's locale, and reads
filters.menu.*andfilters.menu.operators.*translations (see Translations).
A column can declare filterType when its displayed cell uses another representation, and filterOperators to offer only operators its server supports. For remote choices, optionsLoader(query, signal) supplies typed IDs and labels; optionsSearchMinLength and optionsSearchDebounceMs control when it runs. Searches discard stale responses, preserve selected labels, and report failures in the editor. Apply the same AND/OR rules on the server before pagination and totals. Application-owned filterRenderer controls remain available.
Saved views replace filter presets: save a filtered view to reuse a set of rules. The former React filter components (AdvancedFilterPanel, EnhancedFilterChip, FilterPresetsPanel, ModernAddFilterDropdown, the per-type filters such as DateFilter, and useFilterPresets) and Vue's AdvancedFilters and FilterRule are gone; see Migration.
Date rules
The editor of a date rule offers three choices as a segmented radio group:
Relative: "This", "Past" or "Next", then a count and a unit (day, week, month, year), such as "Past 2 weeks". The period moves with the calendar.
Exact date: one day, picked in a month calendar.
Date range: the first and last days, picked in the same calendar, both included.
The calendar highlights the period the rule covers, relative periods included. Relative choices are stored as tokens, so a saved "This month" still means this month next month.
To keep one date column's period at hand, name it in the table configuration:
table: {
enableAdvancedFilters: true,
toolbarDateFilter: "updatedAt",
}The toolbar then shows that period with the days it covers today ("This month · Oct 1 – Oct 31") and edits it in one click; picking that column from the Filter screen opens the same period instead of adding a second rule. A date column listed in table.filterBarColumns gets the same period in the filter bar: any date, a relative choice, or days from / to. Each of these periods is one advanced rule (filter-bar-<columnId>), so charts, calendars and the other display modes filter by it and list receives it as any date rule.
Keep value types intact
Select values are stable IDs, not their translated labels. A multi-select stores an array. Numbers and booleans must stay numeric and boolean: the string "false" is not the boolean false. Date filters pick days: a date rule's values are calendar days written YYYY-MM-DD (one day, or the first and last days of between, both included), whether the column holds dates or timestamps; see Date rules. The shared matchesContractFilter helper demonstrates operator semantics in the quick start. Translate the same semantics into your database query.
Try the complete flow
In the catalog recipe, filter to Active, search for “desk”, then clear the filters. Switching to Gallery keeps the query. Check AND and OR with at least two rules and verify counts before and after pagination.
Keep frequent filters directly accessible
Expose Status in the quick filter bar. On compact screens the view filter panel contains these configured shortcuts. The list action must apply filters before pagination.
Copy this complete configuration beside product-config.ts. Use () => exampleConfig as React’s getTableConfig, or :config="exampleConfig" in Vue.
Sample data. Changes stay in this preview.
import { defineTableConfig } from "@/components/ui/yayaw-table/config/helpers";
import { productConfig } from "./product-config";
export const exampleConfig = defineTableConfig({
...productConfig,
table: {
...productConfig.table,
enableColumnFilters: true,
showFilterBar: true,
filterBarColumns: ["status"],
enableAdvancedFilters: false,
},
});Sample data. Changes stay in this preview.
import { defineTableConfig } from "@/components/ui/yayaw-table-vue/config";
import { productConfig } from "./product-config";
export const exampleConfig = defineTableConfig({
...productConfig,
table: {
...productConfig.table,
enableColumnFilters: true,
showFilterBar: true,
filterBarColumns: ["status"],
enableAdvancedFilters: false,
},
});Offer composed filter rules
Enable the advanced editor without a permanent quick bar. Enter a complete numeric value before applying it; the query adapter handles typed rules and AND/OR joins.
Copy this complete configuration beside product-config.ts. Use () => exampleConfig as React’s getTableConfig, or :config="exampleConfig" in Vue.
Sample data. Changes stay in this preview.
import { defineTableConfig } from "@/components/ui/yayaw-table/config/helpers";
import { productConfig } from "./product-config";
export const exampleConfig = defineTableConfig({
...productConfig,
table: {
...productConfig.table,
enableColumnFilters: true,
enableAdvancedFilters: true,
showFilterBar: false,
searchDebounceMs: 250,
},
});Sample data. Changes stay in this preview.
import { defineTableConfig } from "@/components/ui/yayaw-table-vue/config";
import { productConfig } from "./product-config";
export const exampleConfig = defineTableConfig({
...productConfig,
table: {
...productConfig.table,
enableColumnFilters: true,
enableAdvancedFilters: true,
showFilterBar: false,
searchDebounceMs: 250,
},
});Facets beside the records
table.facets shows a panel of facets beside the records, in every display
mode but the Form view. Each column it lists shows its values with their
number of records, and a click filters the table:
table: {
facets: {
columns: ["category", { id: "tags", limit: 12 }],
position: "left", // or "right"
defaultOpen: true, // phones open the panel as a sheet from the toolbar
},
}Columns: select, tag and status columns, multi-select and tags columns, booleans (Yes and No) and a file tree's parent column (its folders, with "Root"). A column is an id or
{ id, label?, limit?, sort?, showEmpty? }. The panel also takeslimit(8 values before "Show N more" and a search),showCounts(defaulttrue),showZero(defaultfalse) andwidth(256px, from 180 to 480).Filtering: a click writes the rule the filter menus write:
isAnyOf, orcontainsfor lists; "No value" writesisEmptyon its own. The rules join the others with AND. A selection is ordinary filter state: it goes in the URL (<tableId>-advancedFilters), is saved with views and is listed in the filter menus, and a table with facets shows the advanced filter menu. While the view joins its rules with OR, the panel says so and leaves them alone.Counts: the table asks
actions.aggregateas a chart does (groupBy: [{ columnId }],metrics: [{ fn: "count" }]) with the view's search and filters, without the facet's own rule, so a facet keeps offering its other values. Withoutaggregate, counts come from the rowslistreturns (2,000 at most, with a notice beyond), or from the table's own rows (Vuedata). A tags column counts each tag once per record.Keyboard and phones: "Clear" per facet and "Clear all"; arrow keys, Home and End move between values, Space and Enter toggle one. The toolbar button (
[data-facets-toggle],aria-pressed, with a badge while facets filter the view) shows and hides the panel; phones open it as a sheet. Facets need column filters (enableColumnFiltersnotfalse).
Facet labels have built-in English and French, chosen from the table's
locale, and read facets.<key> translations.
Filter by folder
A table whose rows form a file tree filters its parent
column with a folder picker in the filter menus, in every view: the root, or
one or more folders (their direct content). The rule is isAnyOf with the
folder ids, or isEmpty for the root, and reads "In" and the folder's name.
A facet on the parent column lists the same folders with their numbers of
records. table.filetree.folderFilter: false turns the picker off; see
Folders in the other views.
Relative dates
A date rule's value can be a token instead of days: $today, $yesterday, $tomorrow, $thisWeek, $lastWeek, $nextWeek, $thisMonth, $lastMonth, $nextMonth, $thisYear, $lastNDays and $nextNDays (N from 1 to 3660, today included), $lastYear, $nextYear, and rolling periods $last<N><Unit> and $next<N><Unit> with a unit of Days, Weeks, Months or Years, such as $last2Weeks or $next3Months. For example { "columnId": "due", "operator": "between", "values": "$thisWeek" }; before and after with $today read "before today" and "after today". The date rule editor offers them under Relative, next to Exact date and Date range.
Saved views, links and table.defaultFilters keep the tokens, so a view keeps meaning "this week" whenever it is opened. The table resolves them to days in table.timeZone (else the viewer's zone) before it calls list, aggregate or facet counts; weeks start on table.weekStartsOn (0 = Sunday to 6), else on the locale's first day. A server that runs a saved query later resolves it with resolveFilterTokens() (see server actions).
Records of the viewer
A rule whose value is $viewer matches table.viewerId, set by the host to the signed-in user's id: { "columnId": "owner", "operator": "equals", "values": "$viewer" } reads "assigned to me" for whoever opens the view. Without viewerId, $viewer reaches the server unchanged for it to replace with its signed-in user.