Components
Component overrides
export interface IBuilderComponentsProps {Alert?: React.ComponentType<IAlertProps>;form?: {Select?: React.ComponentType<ISelectProps>;SelectMulti?: React.ComponentType<ISelectMultiProps>;Switch?: React.ComponentType<ISwitchProps>;Input?: React.ComponentType<IInputProps>;};Remove?: React.ComponentType<IButtonProps>;Add?: React.ComponentType<IButtonProps>;OutlinedButton?: React.ComponentType<IButtonProps>;TextModeToggleContent?: React.ComponentType<ITextModeToggleContentProps>;TextModeEditor?: React.ComponentType<ITextModeEditorProps>;TextModeInput?: React.ComponentType<ITextModeInputProps>;CloneButton?: React.ComponentType<ICloneButtonProps>;LockToggle?: React.ComponentType<ILockToggleProps>;HistoryControls?: React.ComponentType<IHistoryControlsProps>;Rule?: React.ComponentType<IRuleContainerProps>;Group?: React.ComponentType<IGroupContainerProps>;GroupHeaderOption?: React.ComponentType<IGroupHeaderOptionProps>;Text?: React.ComponentType<React.ComponentProps<typeof Text>>;DropZone?: React.ComponentType<IDropZoneProps>;EmptyGroupDropZone?: React.ComponentType<IEmptyGroupDropZoneProps>;Popover?: React.ComponentType<IPopoverProps>;PopoverItem?: React.ComponentType<IPopoverItemProps>;}
Text mode editor props
export interface ITextModeEditorProps {value: string;diagnostics: ITextModeDiagnostic[];protectedRanges?: ITextModeProtectedRange[];protectedRangesMessage?: string | null;protectedRangeHoverMessage?: string | null;errorMessage: string | null;colorScheme?: 'light' | 'dark';readOnly?: boolean;onChange: (value: string) => void;}export interface ITextModeInputProps {value: string;onChange: (value: string) => void;className?: string;inputClassName?: string;disabled?: boolean;readOnly?: boolean;spellCheck?: boolean;inputDataTest?: string;}
CloneButton props
export interface ICloneButtonProps {nodeType: 'rule' | 'group';disabled?: boolean;onClick?: () => void;className?: string;title?: string;'data-test'?: string;}
LockToggle props
export type BuilderLockState = 'unlocked' | 'self' | 'all';export interface ILockToggleProps {state: BuilderLockState;nodeType: 'rule' | 'group';disabled?: boolean;onChange?: (nextState: BuilderLockState) => void;className?: string;title?: string;'data-test'?: string;}
HistoryControls props
export interface IHistoryControlsProps {undoButton: React.ReactNode;redoButton: React.ReactNode;canUndo: boolean;canRedo: boolean;onUndo: () => void;onRedo: () => void;className?: string;}
Props
AlertReplaces the built-in alert component used for builder-level notices such as blocked text mode.form.Select/form.SelectMulti/form.Switch/form.InputReplace the built-in form controls used by rules and groups.RemoveandAddReplace action buttons used for structural editing.OutlinedButtonReplaces the built-in outlined action button used by undo, redo, and the builder/text mode toggle.TextModeToggleContentReplaces the label-and-icon content rendered inside the builder/text mode toggle button.TextModeEditorReplaces the whole text-mode editor surface. This is the integration point for Monaco and other advanced editors.TextModeInputReplaces only the input layer used by the built-in text editor.CloneButtonReplaces the built-in clone control used whencloneableis enabled.LockToggleReplaces the built-in lock control used whenlockableis enabled.HistoryControlsReplaces the layout wrapper around the built-in undo and redo controls used when history controls are enabled.RuleandGroupReplace the main structural containers.GroupHeaderOptionReplaces the header option control used in group UIs.TextReplaces the built-in text rendering component.DropZoneandEmptyGroupDropZoneReplaces drag-and-drop target renderers.PopoverandPopoverItemReplaces the popover UI used by group creation mode where relevant.
Key prop contracts
form.InputReceivestype,value,onChange(value), and optionaldisabled,id, andname.form.SelectReceivesvalues,selectedValue,emptyValue, andonChange(value).form.SelectMultiReceivesselectedValue,values,onChange(value), andonDelete(value).form.SwitchReceivesswitched, optionalonChange(value), and optionaldisabled.TextModeEditorReceives the current SQL text, diagnostics, optional protected ranges, an optional hover message, the Builder's optionalcolorScheme, andonChange(value).TextModeInputReceives the current text value plus controlled input props such asdisabled,readOnly, and class names used by the built-in text-mode layout.CloneButtonReceivesnodeType, optionaldisabled, andonClick().LockToggleReceivesstate,nodeType, optionaldisabled, andonChange(nextState).HistoryControlsReceives built-inundoButtonandredoButtonnodes pluscanUndo,canRedo,onUndo(), andonRedo().RuleReceives already-builtchildren,controls, and optionaldragHandle.GroupReceivescontrolsLeft,controlsRight,children, and optional overlays or drag handles.DropZoneReceivesid,index, optionalparentId, and drag-state flags.EmptyGroupDropZoneReceives the target group id plus drag-state flags for empty containers.
Monaco subpackage
createMonacoComponents
import '@vojtechportes/react-query-builder/styles.css';import { createMonacoComponents } from '@vojtechportes/react-query-builder/monaco';import { components as muiComponents } from '@vojtechportes/react-query-builder/mui/v9';const components = createMonacoComponents(muiComponents);<Builderfields={fields}data={data}textModecomponents={components}onChange={setData}/>;
@vojtechportes/react-query-builder/monacoExportscreateMonacoComponents,createMonacoComponentSet, andMonacoTextModeEditor.- Stylesheet Import
@vojtechportes/react-query-builder/styles.cssexactly once for both the builder and Monaco integration. The Monaco subpackage does not add another CSS asset. - Styling hooks Use public
--query-builder-*variables or the stable.rqb-monaco-text-mode-editorsurface class. Generatedrqb_[local]_[hash]classes are private. - Color scheme An explicit Builder
colorSchemereactively selects the packaged light or dark Monaco theme. Both themes use the same query-builder palette roles as the built-in SQL editor for keywords, operators, delimiters, strings, numbers, predefined values, and identifiers. An undefined scheme uses the packaged light theme. Monaco's standalone theme service is global, so the latest mounted packaged editor, or the editor whose scheme changes most recently, wins across all mounted Monaco editors. - Peer dependency
monaco-editoris optional and only required when you use that subpackage. - When to use it Prefer it when text mode must preserve locked rules or groups through protected editor ranges.
- Protected ranges Monaco text mode can render locked SQL fragments as dimmed protected ranges with hover messaging while still allowing edits around them.
Documentation