Skip to content

Search and Filters

Search narrows the visible board so users can focus on a title, owner or priority. Hidden cards remain in the source data and continue to count toward work-in-progress limits.

Interactive example

Find the right work

Filters change which cards are visible without deleting source cards.

Try it: Show only high-priority work, search for research, then clear the filter.

Loading example…

What to notice: Clearing filters restores all four source cards.

TypeScript source

Install the packages from Getting Started, then use this source in your app.

state-and-filtering.ts
import type { KanbanPlugin } from '@revolist/kanban';
import type { WorkCard } from './first-board';
export function showHighPriority(kanban: KanbanPlugin<WorkCard>) {
kanban.setFilter({ predicate: card => card.priority === 'high' });
}
export function searchResearch(kanban: KanbanPlugin<WorkCard>) {
kanban.setFilter({ query: 'research', fields: ['title'] });
}
export function clearFilters(kanban: KanbanPlugin<WorkCard>) { kanban.setFilter(); }
// An app-owned snapshot of serializable data, not a Kanban remote-store API.
export function captureBoard(kanban: KanbanPlugin<WorkCard>) {
return { cards: kanban.getCards().map(card => ({ ...card })), columns: [...kanban.getColumnOrder()], collapsed: [...kanban.getCollapsedColumnProps()], selected: [...kanban.getSelectedCardIds()] };
}
export async function restoreBoard(grid: HTMLRevoGridElement, kanban: KanbanPlugin<WorkCard>, saved: ReturnType<typeof captureBoard>) {
grid.source = saved.cards.map(card => ({ ...card }));
await new Promise<void>(resolve => requestAnimationFrame(() => requestAnimationFrame(() => resolve())));
kanban.setColumnOrder(saved.columns);
for (const prop of kanban.getColumnOrder()) kanban.setColumnCollapsed(prop, saved.collapsed.includes(prop));
kanban.setSelectedCardIds(saved.selected);
}
// Persist JSON.stringify(captureBoard(kanban)) in your application's storage.
// Restore only data validated by your application; the live example stays in memory.
Download state-and-filtering.ts

Try it: choose High priority only, then Find research, then Clear filters. Each action replaces the previous filter; all four cards return in their original positions when cleared.

Core RevoGrid filters are evaluated against canonical cards and the host’s captured table columns. Kanban then composes its lightweight search and predicate:

grid.kanban = {
...config,
filter: {
query: searchInput.value,
fields: ['title', 'owner', 'labels'],
predicate: (card) => !card.archived,
},
};

A card must pass all three layers: RevoGrid filters, query matching, and the predicate. Search defaults to the configured card title field.

Header counts expose visible and total cards when filters differ. WIP limits always count all canonical cards.

grid.kanbanToolbar = {
actions: [], search: true, workflowFilter: true,
viewSwitcher: false,
filters: [{ id: 'priority', field: 'priority', label: 'Priority' }],
};

Install KanbanToolbarPlugin to render these controls. Set actions: [] when the toolbar should filter rather than edit the board.

Kanban filters are local projections of the cards available to the board. They are not a server query over records that have not loaded. Apply server filters in your application’s loader and replace its dataset/query identity when that dataset changes; see remote loading.

Continue with undo and redo, WIP counts and toolbar configuration. See the Kanban API for exact types and signatures.