Skip to main content

QueryBuilderContextProps<F, O>

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

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:439

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:421

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:427

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:433

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:834

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; 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:829

Defines replacement components.


debugMode?

optional debugMode?: boolean

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

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:350

Enables drag-and-drop features.

Default

false

Inherited from

QueryBuilderFlags.enableDragAndDrop


enableMountQueryChange?

optional enableMountQueryChange?: boolean

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

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:445

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:344

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:409

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:415

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:391

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:363

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:397

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:403

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:369

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:375

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:385

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


suppressStandardClassnames?

optional suppressStandardClassnames?: boolean

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

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:839

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.