Adapters

Adapters render the same Filter tree and the same schema. This keeps product teams free to match a design system without forking query semantics.

Ant Design

import { AntdFilterBuilder } from '@x-filter/antd';
 
<AntdFilterBuilder
  dsl
  errors={validation.errors}
  labels={{
    addRule: 'Add rule',
    addGroup: 'Add group',
    removeRule: 'Remove rule',
    removeGroup: 'Remove group',
  }}
  schema={schema}
  value={filter}
  onChange={setFilter}
/>;

shadcn

import { ShadcnFilterBuilder } from '@x-filter/shadcn';
 
<ShadcnFilterBuilder
  dsl
  errors={validation.errors}
  schema={schema}
  value={filter}
  onChange={setFilter}
/>;

Shared contract

Both adapters accept:

PropPurpose
schemaField model used by selectors, value editors, and validation.
valueControlled Filter tree.
onChangeReceives the next Filter tree after mutations.
errorsValidation errors keyed by rule or group id.
dslEnables the DSL editor above the visual builder.
dndEnables drag-and-drop and keyboard move controls.

Try both adapters

Adapter parity workbenchSwitch UI adapters while preserving the same schema and filter state.
Valid
Adapter
AND
Account tier
equals
Enterprise
Contract value
>
Region
is any of
Output
{
  "combinator": "and",
  "children": [
    {
      "field": "accountTier",
      "operator": "equals",
      "value": "enterprise"
    },
    {
      "field": "contractValue",
      "operator": "gt",
      "value": 50000
    },
    {
      "field": "region",
      "operator": "in",
      "value": [
        "na",
        "emea"
      ]
    }
  ]
}