Skip to main content

QueryBuilderContextProps<F extends FullField = FullField, O extends string = string>

Defined in: packages/react-querybuilder/src/types/props.ts:829

Props passed down through context from a QueryBuilderContextProvider.

Extends​

Extended by​

Type Parameters​

Type ParameterDefault type
F extends FullFieldFullField
O extends stringstring

Properties​

addRuleToNewGroups?​

optional addRuleToNewGroups?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:452

Adds a new default rule automatically to each new group.

Default​

false

Inherited from​

QueryBuilderFlags.addRuleToNewGroups


autoSelectField?​

optional autoSelectField?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:434

Select the first field in the array automatically.

Default​

true

Inherited from​

QueryBuilderFlags.autoSelectField


autoSelectOperator?​

optional autoSelectOperator?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:440

Select the first operator in the array automatically.

Default​

true

Inherited from​

QueryBuilderFlags.autoSelectOperator


autoSelectValue?​

optional autoSelectValue?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:446

Select the first value in the array automatically. Only applicable when the value editor renders a select list.

Default​

false

Inherited from​

QueryBuilderFlags.autoSelectValue


controlClassnames?​

optional controlClassnames?: Partial<Classnames>

Defined in: packages/react-querybuilder/src/types/props.ts:841

This can be used to assign specific CSS classes to various controls that are rendered by QueryBuilder.


controlElements?​

optional controlElements?: Partial<{ actionElement: ComponentType<ActionProps>; addGroupAction: ComponentType<ActionProps> | null; addRuleAction: ComponentType<ActionProps> | null; cloneGroupAction: ComponentType<ActionProps> | null; cloneRuleAction: ComponentType<ActionProps> | null; combinatorSelector: ComponentType<CombinatorSelectorProps> | null; dragHandle: ForwardRefExoticComponent<DragHandleProps & RefAttributes<HTMLElement>> | null; fieldSelector: ComponentType<FieldSelectorProps<F>> | null; inlineCombinator: ComponentType<InlineCombinatorProps> | null; lockGroupAction: ComponentType<ActionProps> | null; lockRuleAction: ComponentType<ActionProps> | null; matchModeEditor: ComponentType<MatchModeEditorProps> | null; muteGroupAction: ComponentType<ActionProps> | null; muteRuleAction: ComponentType<ActionProps> | null; notToggle: ComponentType<NotToggleProps> | null; operatorSelector: ComponentType<OperatorSelectorProps> | null; removeGroupAction: ComponentType<ActionProps> | null; removeRuleAction: ComponentType<ActionProps> | null; rule: ComponentType<RuleProps<string, string>>; ruleGroup: ComponentType<RuleGroupProps<F, O>>; ruleGroupBodyElements: ComponentType<RuleGroupProps<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }, string> & UseRuleGroup>; ruleGroupHeaderElements: ComponentType<RuleGroupProps<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }, string> & UseRuleGroup>; shiftActions: ComponentType<ShiftActionsProps> | null; undoRedoActions: ComponentType<UndoRedoActionsProps> | null; ungroupAction: ComponentType<ActionProps> | null; valueEditor: ComponentType<ValueEditorProps<F, O>> | null; valueSelector: ComponentType<ValueSelectorProps<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }>>; valueSourceSelector: ComponentType<ValueSourceSelectorProps> | null; }>

Defined in: packages/react-querybuilder/src/types/props.ts:836

Defines replacement components.


debugMode?​

optional debugMode?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:362

Enables debug logging for query builders (and React DnD when applicable).

Default​

false

Inherited from​

QueryBuilderFlags.debugMode


enableDragAndDrop?​

optional enableDragAndDrop?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:356

Enables drag-and-drop features.

Default​

false

Inherited from​

QueryBuilderFlags.enableDragAndDrop


enableMountQueryChange?​

optional enableMountQueryChange?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:338

Set to false to avoid calling the onQueryChange callback when the component mounts.

Default​

true

Inherited from​

QueryBuilderFlags.enableMountQueryChange


listsAsArrays?​

optional listsAsArrays?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:458

Store list-type values as native arrays instead of comma-separated strings.

Default​

false

Inherited from​

QueryBuilderFlags.listsAsArrays


preserveQueryStateOnUnmount?​

optional preserveQueryStateOnUnmount?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:350

By default, when the last QueryBuilder component using a given qbId unmounts, its query is removed from the internal Redux store. Set this to true to retain the query state after unmount, which allows a subsequent QueryBuilder with the same qbId to pick up where the previous one left off.

Only meaningful in conjunction with an explicit qbId prop, since automatically generated qbIds are never reused.

Default​

false

Inherited from​

QueryBuilderFlags.preserveQueryStateOnUnmount


resetOnFieldChange?​

optional resetOnFieldChange?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:422

Reset the operator and value when the field changes.

Default​

true

Inherited from​

QueryBuilderFlags.resetOnFieldChange


resetOnOperatorChange?​

optional resetOnOperatorChange?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:428

Reset the value when the operator changes.

Default​

false

Inherited from​

QueryBuilderFlags.resetOnOperatorChange


showCloneButtons?​

optional showCloneButtons?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:397

Show the "Clone rule" and "Clone group" buttons.

Default​

false

Inherited from​

QueryBuilderFlags.showCloneButtons


showCombinatorsBetweenRules?​

optional showCombinatorsBetweenRules?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:369

Show group combinator selectors in the body of the group, between each child rule/group, instead of in the group header.

Default​

false

Inherited from​

QueryBuilderFlags.showCombinatorsBetweenRules


showLockButtons?​

optional showLockButtons?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:410

Show the "Lock rule" and "Lock group" buttons.

Default​

false

Inherited from​

QueryBuilderFlags.showLockButtons


showMuteButtons?​

optional showMuteButtons?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:416

Show the "Mute rule" and "Mute group" buttons.

Default​

false

Inherited from​

QueryBuilderFlags.showMuteButtons


showNotToggle?​

optional showNotToggle?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:375

Show the "not" (aka inversion) toggle for rule groups.

Default​

false

Inherited from​

QueryBuilderFlags.showNotToggle


showShiftActions?​

optional showShiftActions?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:381

Show the "Shift up"/"Shift down" actions.

Default​

false

Inherited from​

QueryBuilderFlags.showShiftActions


showUndoRedo?​

optional showUndoRedo?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:391

Show the "Undo"/"Redo" actions in the header of the outermost group.

Requires the QueryBuilderHistory component from react-querybuilder/history, which provides the controls and records the history they navigate. Defaults to true when a QueryBuilderHistory ancestor is present (pass false explicitly to opt out).

Default​

false

Inherited from​

QueryBuilderFlags.showUndoRedo


showUngroupButtons?​

optional showUngroupButtons?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:404

Show the "Ungroup" button on each non-root group, which replaces the group with its own rules in the parent group.

Default​

false

Inherited from​

QueryBuilderFlags.showUngroupButtons


suppressStandardClassnames?​

optional suppressStandardClassnames?: boolean

Defined in: packages/core/src/types/queryBuilder.ts:465

Prevent any assignment of standard classes to elements. This includes conditional and event-based classes for validation, drag-and-drop, etc.

Default​

false

Inherited from​

QueryBuilderFlags.suppressStandardClassnames


translations?​

optional translations?: Partial<Translations>

Defined in: packages/react-querybuilder/src/types/props.ts:846

This can be used to override translatable texts applied to the various controls that are rendered by QueryBuilder.


caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.