Home / Components / FilterBuilder FilterBuilder combines criteria into a typed expression. The application uses that expression to filter a local table or send a query to a service.
Change the priority range or add a group to see which incidents still match. The table uses the last valid expression.
Demo Source
Filter incidents Add condition Add group
4 rows; page 1; 0 selected; sort: none Password reset 2 Open Support Invoice export 3 Resolved Operations Search results 4 Open Product Email notifications 5 Open Product
View applied expression {
"kind": "group",
"operator": "and",
"children": [
{
"kind": "condition",
"field": "priority",
"rule": "between",
"value": [
2,
5
]
}
]
} Compare immediate updates with applying the expression explicitly. Read only preserves the expression for inspection.
Demo Source
<neu-filter-builder [fields]="fields()" [value]="value()" [commit]="commit()" [readonly]="readonly()" (valueChange)="value.set($event)" />These values match the current preview. Complete handlers, Core imports and templates are in Source.
import { signal } from '@angular/core';
export const fields = signal([
{
"field": "priority",
"label": "Priority",
"type": "number",
"rules": [
"between",
"equals"
]
}
]);
export const value = signal({
"kind": "group",
"operator": "and",
"children": [
{
"kind": "condition",
"field": "priority",
"rule": "between",
"value": [
2,
5
]
}
]
});
export const commit = signal("immediate");
export const readonly = signal(false);Replace the free-text editor with a Neural Select. Pass the chosen status back through the template context and watch the applied expression change.
Provide fields and the applied value. Accept valueChange to replace the expression.
The examples use visible labels and follow the focus order of the live controls.
Tab Move among group controls, conditions and actions. Enter / Space Open a selector or activate the focused button. Escape Close the open selector.
Configure fields and labels, control the expression, and decide when valid edits apply.
Inputs Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.
commit"explicit" | "immediate"'explicit'[commit]Choose whether valid changes apply immediately or via the apply button. editorTemplateRef<NeuFilterBuilderEditorContext <F>> | nullnull[editor]Template for a custom condition editor. fieldsreadonly NeuFilterBuilderField <F>[]Required [fields]Available field definitions and their supported rules. labelsPartial<NeuFilterBuilderLabels >{}[labels]Override the builderโs localized labels and messages. readonlybooleanfalse[readonly]Keep the expression visible and prevent editing. valueNeuFilterExpression <F> | nullnull[value]Currently applied filter expression.
Outputs Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.
valueChangeNeuFilterExpression <F> | null(valueChange)="onValueChange($event)"Proposes the next valid expression, or null when cleared.
Templates ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.
Usage example Content between the button tags is projected content. You can supply text, an icon component or an SVG; the Icons section demonstrates these variants. For iconOnly, omit visible text and provide ariaLabel: projected content is not automatically removed.
Public Types Open a type to inspect its definition and interface fields.
import type { NeuFilterBuilderField } from '@neural-ui/core/filter-builder';
import type { NeuFilterConstraint } from '@neural-ui/core/table';
import type { NeuFilterBuilderEditorContext } from '@neural-ui/core/filter-builder';
// Public declaration (reference only)
interface NeuFilterBuilderEditorContext<F extends string> {
readonly $implicit: NeuFilterConstraint<F>;
readonly field: NeuFilterBuilderField<F> | undefined;
readonly readonly: boolean;
readonly setValue: (value: unknown) => void;
}import type { NeuFilterConstraint } from '@neural-ui/core/table';
import type { NeuFilterBuilderField } from '@neural-ui/core/filter-builder';
// Public declaration (reference only)
interface NeuFilterBuilderField<F extends string> {
readonly field: F;
readonly label: string;
readonly rules?: readonly NeuFilterConstraint<F>['rule'][];
readonly type?: 'text' | 'number';
}import type { NeuFilterConstraint } from '@neural-ui/core/table';
import type { NeuFilterBuilderLabels } from '@neural-ui/core/filter-builder';
// Public declaration (reference only)
interface NeuFilterBuilderLabels {
readonly addCondition: string;
readonly addGroup: string;
readonly all: string;
readonly any: string;
readonly apply: string;
readonly field: string;
readonly group: string;
readonly invalidValue: string;
readonly operator: string;
readonly remove: string;
readonly reset: string;
readonly root: string;
readonly rule: string;
readonly rules: Record<NeuFilterConstraint<string>['rule'], string>;
readonly value: string;
}import type { NeuFilterConstraint } from '@neural-ui/core/table';
// Public declaration (reference only)
export interface NeuFilterConstraint<F extends string> {
readonly field: F;
readonly kind: 'condition';
readonly rule: 'equals' | 'notEquals' | 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'lessThan' | 'lessThanOrEqual' | 'greaterThan' | 'greaterThanOrEqual' | 'between' | 'in' | 'notIn' | 'isNull' | 'isNotNull' | 'isEmpty' | 'isNotEmpty';
readonly value: unknown;
}import type { NeuFilterConstraint } from '@neural-ui/core/table';
import type { NeuFilterGroup } from '@neural-ui/core/table';
import type { NeuFilterExpression } from '@neural-ui/core/table';
// Public declaration (reference only)
export type NeuFilterExpression<F extends string> = NeuFilterConstraint<F> | NeuFilterGroup<F>;import type { NeuFilterExpression } from '@neural-ui/core/table';
import type { NeuFilterOperator } from '@neural-ui/core/table';
import type { NeuFilterGroup } from '@neural-ui/core/table';
// Public declaration (reference only)
export interface NeuFilterGroup<F extends string> {
readonly children: readonly NeuFilterExpression<F>[];
readonly kind: 'group';
readonly operator: NeuFilterOperator;
}import type { NeuFilterOperator } from '@neural-ui/core/table';
// Public declaration (reference only)
export type NeuFilterOperator = 'and' | 'or';The builder uses the existing Neural form controls. Apply the application theme to keep conditions and table controls visually consistent.
Specific tokens This component uses shared theme tokens rather than dedicated component hooks.
Shared tokens used Override these on a local wrapper to affect this example. An override on :root affects other components that use the same token.
PreviousFilterBar Next Kanban