Components
Replace built-in controls and containers through the components prop.
Component overrides
import '@vojtechportes/react-query-builder/styles.css';const components = {Add: MyAddButton,Remove: MyRemoveButton,form: {Input: MyInput,Select: MySelect,},};<Builderdata={data}fields={fields}components={components}onChange={setData}/>;
Override contracts
- Form controls should behave like controlled inputs. They receive the current value plus change handlers and disabled state.
RuleandGroupare layout containers. They receive already-prepared children and control regions rather than raw builder state.DropZoneandEmptyGroupDropZoneare drag-and-drop render hooks. They receive ids, indices, parent ids, drag state, and active state.- Button-like overrides such as
Add,Remove,Popover, andPopoverItemshould preserve click semantics and remain accessible. HistoryControlsreceives built-in undo and redo button nodes plus history state and handlers, so custom layouts can reuse the default controls instead of recreating them.TextModeEditorreplaces the whole text-mode editor surface. This is the correct override point for Monaco or other advanced editors.TextModeInputreplaces only the input control used by the built-in text editor. It is useful when you want the built-in overlay editor behavior but need a UI-library-specific input shell.TextModeToggleContent,OutlinedButton, andAlertlet you align text-mode controls and warnings with your design system.
Responsive behavior
- The built-in
RuleandGroupcomponents include a compact responsive layout for. - Multi-select controls use a summarized closed state so selected values do not overflow the available rule width.
- Responsive behavior is automatic when you use the default components.
- If you replace
components.Ruleorcomponents.Group, your custom layout is responsible for its own responsive behavior.
Adapter packages
If you want ready-made component mappings instead of wiring every override by hand, see Adapters.
Related docs
Text Mode covers the built-in SQL editor and the optional Monaco editor integration.
API reference