Skip to main content

react-querybuilder

Components

NameDescription
QueryBuilderContextProvider-
DragHandleDefault drag handle component used by QueryBuilder when enableDragAndDrop is true.
RuleDefault component to display RuleType objects. This is actually a small wrapper around RuleComponents.
RuleComponentsRenders a React.Fragment containing an array of form controls for managing a RuleType.
RuleComponentsWithSubQuery-
RuleGroupDefault component to display RuleGroupType and RuleGroupTypeIC objects. This is actually a small wrapper around RuleGroupHeaderComponents and RuleGroupBodyComponents.
RuleGroupBodyComponentsRenders a React.Fragment containing an array of either (1) Rule and RuleGroup, or (2) Rule, RuleGroup, and InlineCombinator.
RuleGroupHeaderComponentsRenders a React.Fragment containing an array of form controls for managing a RuleGroupType or RuleGroupTypeIC.
ActionElementDefault <button> component used by QueryBuilder.
InlineCombinatorDefault inlineCombinator component used by QueryBuilder. A small <div> wrapper around the combinatorSelector component, used when either showCombinatorsBetweenRules or independentCombinators are true.
MatchModeEditorDefault matchModeEditor component used by QueryBuilder.
NotToggleDefault notToggle (aka inversion) component used by QueryBuilder.
QueryBuilderThe query builder component for React.
QueryBuilderStateProviderContext provider for the {@link QueryBuilder} state store.
RuleWithSubQueryGroupComponentsWrapper-
ShiftActionsDefault "shift up"/"shift down" buttons used by QueryBuilder.
ValueEditorDefault valueEditor component used by QueryBuilder.
ValueSelectorDefault <select> component used by QueryBuilder.

Props

NameDescription
ActionPropsProps passed to every action component (rendered as <button> by default).
ActionWithRulesAndAddersPropsProps passed to every action component that adds a rule or group.
ActionWithRulesPropsProps passed to every group action component.
BaseTranslationA translation for a component with title only.
BaseTranslationsThe shape of the translations prop.
BaseTranslationWithLabelA translation for a component with title and label.
BaseTranslationWithPlaceholdersA translation for a component with title and a placeholder.
ClassnamesClassnames applied to each component.
CombinatorSelectorPropsProps for combinatorSelector components.
CommonRuleSubComponentPropsBase interface for all rule subcomponents.
CommonSubComponentPropsBase interface for all subcomponents.
DragHandlePropsProps for dragHandle components.
FieldSelectorPropsProps for fieldSelector components.
InlineCombinatorPropsProps passed to inlineCombinator components.
MatchModeEditorPropsProps for matchModeEditor components.
NotTogglePropsProps for notToggle components.
OperatorSelectorPropsProps for operatorSelector components.
PlaceholderPlaceholder strings for option lists.
QueryActionsFunctions included in the actions prop passed to every subcomponent.
QueryBuilderContextPropsProps passed down through context from a QueryBuilderContextProvider.
QueryBuilderContextProviderProps-
RuleGroupPropsRuleGroup props.
RulePropsRule props.
SchemaConfiguration options passed in the schema prop from QueryBuilder to each subcomponent.
SelectorOrEditorPropsBase interface for selectors and editors.
ShiftActionsPropsProps passed to shiftActions components.
TranslationA translation for a component with title only.
TranslationsThe shape of the translations prop.
TranslationWithLabelA translation for a component with title and label.
TranslationWithPlaceholdersA translation for a component with title and a placeholder.
UndoRedoActionsPropsProps passed to undoRedoActions components.
UseMergedContextProps passed down through context from a QueryBuilderContextProvider.
UseRuleRule props.
UseRuleGroupRuleGroup props.
ValueEditorPropsProps passed to valueEditor components.
ValueSelectorPropsProps for all value selector components.
ValueSourceSelectorPropsProps for valueSourceSelector components.
BaseTranslationsFullThe full translations interface with all properties required.
ControlElementsPropSubcomponents.
ControlKeyThe name of a query builder control.
ControlsAll subcomponents.
QueryBuilderPropsProps for QueryBuilder.
TranslationsFullThe full translations interface with all properties required.
VersatileSelectorPropsUtility type representing props for selector components that could potentially be any of the standard selector types.
controlKeysThe name of every query builder control, alphabetized.
controlKindWhich bulk override, if any, applies to each control: "action" for controls that a supplied actionElement replaces, "selector" for controls that a supplied valueSelector replaces, and null for controls that neither replaces.
controlPropKeysThe full set of prop names each default control receives. Ports can use this to declare every prop explicitly instead of relying on fall-through/attribute inheritance.

Hooks

NameDescription
useQueryBuilderSelectorA Redux useSelector hook for RQB's internal store. See also getQuerySelectorById.
useControlledOrUncontrolledLogs a warning when the component changes from controlled to uncontrolled, vice versa, or both query and defaultQuery are provided.
useDeprecatedPropsLogs an error to the console if any of the following are true: - QueryBuilder is rendered with an independentCombinators prop - RuleGroup is rendered with combinator or rules props (deprecated in favor of ruleGroup) - Rule is rendered with field, operator, or value props (deprecated in favor of rule)
useMergedContextMerges inherited context values with props, giving precedence to props.
useOptionListProp-
usePreferAnyPropFor given default, prop, and context values, return the first provided of prop, context, and default, in that order.
usePreferPropFor given default, prop, and context values, return the first provided of prop, context, and default, in that order.
usePreviousReturns the prop value from the last render.
useQbIdManages the qbId for a QueryBuilder instance.
useQueryBuilderCalls useQueryBuilderSetup to massage the props and prepare basic update/generate methods, then passes the result to useQueryBuilderSchema to prepare and return all values required to render QueryBuilder.
useQueryBuilderQueryRetrieves the full, latest query object for the nearest ancestor QueryBuilder component.
useQueryBuilderSchemaFor given QueryBuilderProps and setup values from useQueryBuilderSetup, prepares and returns all values required to render a query builder.
useQueryBuilderSetupMassages the props as necessary and prepares the basic update/generate methods for use by the QueryBuilder component.
useQueryManagerSubscribes to a QueryManager and returns its current query alongside the manager itself. The component re-renders whenever the query changes.
useReactDndWarningLogs a warning if drag-and-drop is enabled but the required dependencies (react-dnd and either react-dnd-html5-backend or react-dnd-touch-backend) were not detected.
useRulePrepares all values and methods used by the Rule component.
useRuleGroupPrepares all values and methods used by the RuleGroup component.
useSelectElementChangeHandlerReturns a memoized change handler for HTML <select> elements.
useStopEventPropagationWraps an event handler function in another function that calls event.preventDefault() and event.stopPropagation() first. The returned function accepts and forwards a second context argument.
useUndoRedoWarningLogs a warning if the showUndoRedo prop is enabled but no undo/redo controls are available, which generally means the query builder was not wrapped in the QueryBuilderHistory component from react-querybuilder/history.
useValueEditorThis hook is primarily concerned with multi-value editors like date range pickers, editors for 'in' and 'between' operators, etc.
useValueSelectorTransforms a value into an array when appropriate and provides a memoized change handler.

Export

NameDescription
DiagnosticEntryA single diagnostic entry produced by the "diagnostics" format.
DiagnosticsFieldSummaryEntryPer-field summary entry for the "diagnostics" format.
DiagnosticsResultTop-level result of formatQuery for the "diagnostics" format.
DiagnosticsStatsAggregate statistics for the "diagnostics" format.
DrizzleOperatorsLikeMinimal structural shape of Drizzle's Operators object. Declared locally so the public type surface of this package never references drizzle-orm, which is an optional peer dependency. (Referencing it would force consumers to install it to typecheck without skipLibCheck.)
FormatQueryFinalOptionsOptions object curated by formatQuery and passed to a RuleGroupProcessor.
FormatQueryOptionsOptions object shape for formatQuery.
ParameterizedNamedSQLObject produced by formatQuery for the "parameterized_named" format.
ParameterizedSQLObject produced by formatQuery for the "parameterized" format.
RQBJsonLogicEndsWith-
RQBJsonLogicStartsWith-
RQBJsonLogicVar-
RuleGroupDiagnosticsResultA RuleGroupType annotated with diagnostics results, as produced by formatQuery for the "diagnostics" format.
RuleGroupICDiagnosticsResultA RuleGroupTypeIC annotated with diagnostics results, as produced by formatQuery for the "diagnostics" format (independent combinators).
SequelizeWhereOptionsLikeStructural stand-in for Sequelize's WhereOptions. Declared locally so the public type surface of this package never references sequelize, which is an optional peer dependency. (Referencing it would force consumers to install it to typecheck without skipLibCheck.) Assignable to WhereOptions at the call site, e.g. Model.findAll({ where }).
ValueProcessorOptionsOptions object for ValueProcessorByRule functions.
ConstituentWordOrderConstituent word order (as array) for the "natural_language" format.
ConstituentWordOrderStringConstituent word order (as string) for the "natural_language" format.
DrizzleWhereCallbackReturn type of defaultRuleGroupProcessorDrizzle—the function assignable to the where property in the Drizzle relational queries API. The Drizzle SQL result type is inferred from the caller's own operators object, so it stays exact without importing drizzle-orm here.
ExportFormatAvailable export formats for formatQuery.
ExportObjectFormatsExport formats for formatQuery that produce objects instead of strings.
ExportOperatorMapA map of operators to strings to be used in the output of formatQuery. If the result can differ based on the valueSource, the key should map to an array where the second element represents the string to be used when valueSource is "field". The first element will be used in all other cases.
FormatQueryValidateRuleRule validator for formatQuery.
GroupVariantConditionRule group condition identifier for the "natural_language" format.
NLTranslationKeyKeys for the translations config object used by the "natural_language" format.
NLTranslationstranslations config object for "natural_language" format.
RQBJsonLogicJsonLogic rule object with additional operators generated by formatQuery and accepted by parseJsonLogic!parseJsonLogic.
RuleDiagnosticsResultA RuleType annotated with diagnostics results, as produced by formatQuery for the "diagnostics" format.
RuleGroupDiagnosticsArrayThe type of the rules array in a RuleGroupDiagnosticsResult.
RuleGroupICDiagnosticsArrayThe type of the rules array in a RuleGroupICDiagnosticsResult.
RuleGroupProcessorFunction to produce a result that formatQuery uses when processing a RuleGroupType or RuleGroupTypeIC object.
RuleProcessorFunction to produce a result that formatQuery uses when processing a RuleType object.
SQLPresetAvailable presets for the "sql" export format.
ValueProcessor-
ValueProcessorByRuleFunction that produces a processed value for a given RuleType.
ValueProcessorLegacyFunction that produces a processed value for a given field, operator, value, and valueSource.
celCombinatorMapMaps a DefaultCombinatorName to a CEL combinator.
cypherCombinatorMapMaps a DefaultCombinatorName to a Cypher combinator keyword.
defaultCELValueProcessor-
defaultExportOperatorMapDefault operator map used by formatQuery for "natural_language" format.
defaultMongoDBValueProcessor-
defaultNLTranslationsDefault translations used by formatQuery for "natural_language" format.
defaultOperatorProcessorNLDefault operator processor used by formatQuery for "natural_language" format.
defaultOperatorProcessorSQLDefault operator processor used by formatQuery for "sql" and "parameterized*" formats.
defaultRuleGroupProcessorCELRule group processor used by formatQuery for "cel" format.
defaultRuleGroupProcessorCypherRule group processor used by formatQuery for "cypher" and "gql" formats.
defaultRuleGroupProcessorDiagnosticsRule group processor used by formatQuery for "diagnostics" format.
defaultRuleGroupProcessorDrizzleDefault rule group processor used by formatQuery for the "drizzle" format. The returned function can be assigned to the where property in the Drizzle relational queries API.
defaultRuleGroupProcessorElasticSearchRule group processor used by formatQuery for "elasticsearch" format.
defaultRuleGroupProcessorGremlinRule group processor used by formatQuery for "gremlin" format.
defaultRuleGroupProcessorJSONataRule group processor used by formatQuery for "jsonata" format.
defaultRuleGroupProcessorJsonLogicRule group processor used by formatQuery for "jsonlogic" format.
defaultRuleGroupProcessorLDAPRule group processor used by formatQuery for "ldap" format.
defaultRuleGroupProcessorMongoDBRule group processor used by formatQuery for "mongodb" format.
defaultRuleGroupProcessorMongoDBQueryRule group processor used by formatQuery for "mongodb_query" format.
defaultRuleGroupProcessorNLRule group processor used by formatQuery for "natural_language" format.
defaultRuleGroupProcessorParameterizedRule group processor used by formatQuery for "parameterized" and "parameterized_named" formats.
defaultRuleGroupProcessorPrismaRule group processor used by formatQuery for "prisma" format.
defaultRuleGroupProcessorSequelizeRule group processor used by formatQuery for "sequelize" format.
defaultRuleGroupProcessorSPARQLRule group processor used by formatQuery for "sparql" format.
defaultRuleGroupProcessorSpELDefault rule processor used by formatQuery for "spel" format.
defaultRuleGroupProcessorSQLDefault rule processor used by formatQuery for "sql" format.
defaultRuleGroupProcessorTanStackDBDefault rule group processor used by formatQuery for the "tanstack_db" format. Returns a WhereCallback suitable for TanStack DB's .where() method.
defaultRuleProcessorCELDefault rule processor used by formatQuery for "cel" format.
defaultRuleProcessorCypherDefault rule processor used by formatQuery for "cypher" and "gql" formats.
defaultRuleProcessorDrizzleDefault rule processor used by formatQuery for the "drizzle" format.
defaultRuleProcessorElasticSearchDefault rule processor used by formatQuery for "elasticsearch" format.
defaultRuleProcessorGremlinDefault rule processor used by formatQuery for "gremlin" format.
defaultRuleProcessorJSONataDefault rule processor used by formatQuery for "jsonata" format.
defaultRuleProcessorJsonLogicDefault rule processor used by formatQuery for "jsonlogic" format.
defaultRuleProcessorLDAPDefault rule processor used by formatQuery for "ldap" format.
defaultRuleProcessorMongoDBDefault rule processor used by formatQuery for "mongodb" format.
defaultRuleProcessorMongoDBQueryDefault rule processor used by formatQuery for "mongodb_query" format.
defaultRuleProcessorNLDefault rule processor used by formatQuery for "natural_language" format.
defaultRuleProcessorParameterizedDefault rule processor used by formatQuery for "parameterized" and "parameterized_named" formats.
defaultRuleProcessorPrismaDefault rule processor used by formatQuery for "prisma" format.
defaultRuleProcessorSequelizeDefault rule processor used by formatQuery for the "sequelize" format.
defaultRuleProcessorSPARQLDefault rule processor used by formatQuery for "sparql" format.
defaultRuleProcessorSpELDefault rule processor used by formatQuery for "spel" format.
defaultRuleProcessorSQLDefault rule processor used by formatQuery for "sql" format.
defaultRuleProcessorTanStackDBDefault rule processor used by formatQuery for the "tanstack_db" format.
defaultSpELValueProcessor-
defaultValueProcessorDefault value processor used by formatQuery for "sql" format.
defaultValueProcessorByRuleDefault value processor used by formatQuery for "sql" format.
defaultValueProcessorCELByRule-
defaultValueProcessorMongoDBByRule-
defaultValueProcessorNLDefault value processor used by formatQuery for "natural_language" format.
defaultValueProcessorSpELByRule-
formatQueryOptionPresetsA collection of option presets for formatQuery.
jsonLogicAdditionalOperatorsRegister these operators with jsonLogic before applying the result of formatQuery(query, 'jsonlogic').
mongoDbFallbackDefault fallback object used by formatQuery for "mongodb_query" format.
mongoOperatorsMaps a (lowercase) DefaultOperatorName to a MongoDB operator.
prismaFallbackDefault fallback object used by formatQuery for "prisma" format.
prismaOperatorsMaps a (lowercase) DefaultOperatorName to a Prisma ORM operator.
sqlDialectPresetsA collection of option presets for formatQuery, specifically for SQL-based formats.
formatQueryGenerates a formatted (indented two spaces) JSON string from a query object.
getLikeWildcardsReturns the [prefix, suffix] LIKE wildcards for a string-match operator (e.g. contains['%', '%'], beginsWith['', '%'], endsWith['%', '']). Unknown operators yield ['', ''].
getNLTranslataionUsed by formatQuery to get a translation based on certain conditions for the "natural_language" format.
getQuotedFieldNameGiven a field name and relevant ValueProcessorOptions, returns the field name wrapped in the configured quote character(s).
getQuoteFieldNamesWithArrayConverts the quoteFieldNamesWith option into an array of two strings. If the option is a string, the array elements are both that string.
getSQLConcatReturns a preset-aware SQL string-concatenation function. Emits CONCAT(a, b, ...) when concatOperator is "CONCAT" (case-insensitive), otherwise joins with the infix operator (e.g. `a
getSubqueryElementAliasReturns the element alias for a subquery at the given nesting depth. Depth 0 (the common, non-nested case) uses subqueryElementAliasBase unchanged; deeper levels are suffixed with the depth, so a subquery nested within a subquery cannot shadow its parent's binding.
isValidValueDetermines whether a value is anything except an empty string or NaN.
isValueProcessorLegacyUsed by formatQuery to determine whether the given value processor is a "legacy" value processor by counting the number of arguments. Legacy value processors take 3 arguments (not counting any arguments with default values), while rule-based value processors take no more than 2 arguments.
mapSQLOperatorMaps a DefaultOperatorName to a SQL operator.
normalizeConstituentWordOrderGiven a Constituent word order like "svo" or "sov", returns a permutation of ["S", "V", "O"] based on the first occurrence of each letter in the input string (case insensitive). This widens the valid input from abbreviations like "svo" to more expressive strings like "subject-verb-object" or "sub ver obj". Any missing letters are appended in the default order "SVO" (e.g., "object" would yield ["O", "S", "V"]).
numerifyValuesReturns a new query object with all string-type value properties converted to number where appropriate.
shouldRenderAsNumberDetermines whether formatQuery should render the given value as a number. As long as parseNumbers is true, number and bigint values will return true and string values will return true if they test positive against numericRegex.
sparqlVarAuto-prefix a SPARQL variable name with ? unless it's already prefixed, a URI, or a prefixed name.
stripParamPrefixStrips a leading paramPrefix from a named-parameter value if present. Inverse of withParamPrefix; used to normalize parameter names for validation/lookup.
withParamPrefixPrefixes a named-parameter value with the given paramPrefix unless the value already begins with it. Used by formatQuery to render rules whose valueSource is "parameter" (e.g. "p1" with prefix ":"":p1"; ":p1"":p1").
wrapLikeFragmentWraps an already-serialized SQL fragment (a quoted field name or an expression) with the LIKE wildcards for the given (lowercase) string-match operator, concatenating the literal % markers via the preset-aware getSQLConcat. Returns the fragment untouched for operators without wildcards.

Defaults

VariableDescription
betweenOperatorsRange operators (between, notBetween).
defaultCoalesceMsDefault time window (in milliseconds) within which consecutive changes to the same property of the same rule are coalesced into a single undo step.
defaultCombinatorsDefault combinator list.
defaultCombinatorsExtendedDefault combinator list, with XOR added.
defaultControlClassnamesDefault classnames for each component.
defaultControlElementsDefault components used by QueryBuilder.
defaultJoinCharDefault character used to .join and .split arrays.
defaultMatchModesDefault match modes.
defaultMaxHistoryDefault maximum number of undo steps retained by query history.
defaultOperatorNegationMapMap of default operators to their respective opposite/negating operators.
defaultOperatorsDefault operator list.
defaultPlaceholderFieldGroupLabelDefault label for placeholder option group in the fields array.
defaultPlaceholderFieldLabelDefault label for placeholder option in the fields array.
defaultPlaceholderFieldNameDefault name for placeholder option in the fields array.
defaultPlaceholderLabel-
defaultPlaceholderName-
defaultPlaceholderOperatorGroupLabelDefault label for placeholder option group in the operators array.
defaultPlaceholderOperatorLabelDefault label for placeholder option in the operators array.
defaultPlaceholderOperatorNameDefault name for placeholder option in the operators array.
defaultPlaceholderValueGroupLabelDefault label for placeholder option group in the values array.
defaultPlaceholderValueLabelDefault label for placeholder option in the values array.
defaultPlaceholderValueNameDefault name for placeholder option in the values array.
defaultTranslationsDefault configuration of translatable strings.
groupInvalidReasonsDefault reason codes for a group being invalid.
inOperatorsList-membership operators (in, notIn).
nullOperatorsNull-check operators (null, notNull).
queryBuilderFlagDefaultsDefault values for all boolean QueryBuilder options.
relationalOperatorsRelational/comparison operators (=, !=, <, >, <=, >=).
rootPathThe Path of the root group.
standardClassnamesStandard classnames applied to each component.
substringOperatorsSubstring/text-matching operators (contains, beginsWith, endsWith, and negations).
TestIDComponent identifiers for testing.

Option Lists

NameDescription
BaseOptionDo not use this type directly; use Option, ValueOption, or FullOption instead. For specific option types, you can use FullField, FullOperator, or FullCombinator, all of which extend FullOption.
FullOperatorFull operator definition used in the operators/getOperators props of QueryBuilder. This type requires both name and value, but the operators/getOperators props themselves can use a FlexibleOption where only one of name or value is required, or FullOperator where only name is required.
OptionGroupA group of Options, usually within an OptionList.
BaseFullOptionThis type is identical to FullOption but without the unknown index property. Extend from this type instead of FullOption directly.
BaseOptionMapMap of option identifiers to their respective Option.
CombinatorCombinator definition used in the combinators prop of QueryBuilder. This type is an extension of FullCombinator where only name and label are required.
CombinatorByValueCombinator definition used in the combinators prop of QueryBuilder. This type is an extension of FullCombinator where only value and label are required.
DefaultCombinatorA FullCombinator definition with a DefaultCombinatorName name property.
DefaultCombinatorExtendedA FullCombinator definition with a DefaultCombinatorNameExtended name property.
DefaultCombinatorNameDefault allowed values for the combinator property.
DefaultCombinatorNameExtendedDefault allowed values for the combinator property, plus "xor".
DefaultOperatorAn FullOperator definition with a DefaultOperatorName name property.
DefaultOperatorNameDefault values for the operator property.
FieldField definition used in the fields prop of QueryBuilder. This type is an extension of FullField where only name and label are required.
FieldByValueField definition used in the fields prop of QueryBuilder. This type is an extension of FullField where only value and label are required.
FlexibleOptionA generic Option with either a name or value as its primary identifier. OptionList-type props on the QueryBuilder component accept this type, but corresponding props passed down to subcomponents will always be augmented to FullOption first.
FlexibleOptionGroupA group of BaseOptions, usually within a FlexibleOptionList.
FlexibleOptionListAn array of options or option groups, like OptionList but the option type may use either name or value as the primary identifier.
FlexibleOptionListPropAn array of options or option groups, like OptionList but the option type may use either name or value as the primary identifier.
FullCombinatorFull combinator definition used in the combinators prop of QueryBuilder. This type requires both name and value, but the combinators prop itself can use a FlexibleOption where only one of name or value is required, or Combinator where only name is required.
FullFieldFull field definition used in the fields prop of QueryBuilder. This type requires both name and value, but the fields prop itself can use a FlexibleOption where only one of name or value is required (along with label), or Field where only name and label are required.
FullOptionA generic Option requiring both name and value properties. Props that extend OptionList accept BaseOption, but corresponding props sent to subcomponents will always be augmented to this type first to ensure both name and value are available.
FullOptionListAn array of options or option groups, like OptionList, but using FullOption instead of Option. This means that every member is guaranteed to have both name and value.
FullOptionMapMap of option identifiers to their respective FullOption.
FullOptionRecordMap of option identifiers to their respective FullOption. Must include all possible strings from the identifier type.
GetOptionIdentifierTypeExtracts the type of the identifying property from a Option, ValueOption, or FullOption.
GetOptionTypeExtracts the Option type from a FlexibleOptionList.
NameLabelPair-
OperatorOperator definition used in the operators/getOperators props of QueryBuilder. This type is an extension of FullOperator where only name and label are required.
OperatorByValueOperator definition used in the operators/getOperators props of QueryBuilder. This type is an extension of FullOperator where only value and label are required.
OptionA generic option. Used directly in OptionList or as the child element of an OptionGroup.
OptionListEither an array of Options or an array of OptionGroups.
ToFlexibleOptionUtility type to turn an Option, ValueOption, or BaseOption into a FlexibleOption.
ToFullOptionUtility type to turn an Option, ValueOption or BaseOption into a FullOption.
ValueOptionLike Option but requiring value instead of name.
filterFieldsByComparatorFor a given FullField, returns the fields list filtered for other fields that match by comparator. Only fields other than the one in question will ever be included, even if comparator is null or undefined. If comparator is a string, fields with the same value for that property will be included. If comparator is a function, each field will be passed to the function along with the operator and fields for which the function returns true will be included.
getFirstOptionGets the first option from an OptionList.
getOptionGets the option from an OptionList with the given name. Handles Option arrays as well as OptionGroup arrays.
getRuleDefaultValueComputes the default value for a rule given its field/operator/valueSource, mirroring the precedence the QueryBuilder applies: a field's defaultValue, then a getDefaultValue override, then a value derived from the field/operator's value list and editor type (first option for select/radio, false for checkbox, paired for between/notBetween), or a comparator-valid field when valueSource is 'field'. Falls back to ''.
isFlexibleOptionArrayDetermines if an array is a flat array of FlexibleOption.
isFlexibleOptionGroupArrayDetermines if a FlexibleOptionList is a FlexibleOptionGroup array.
isFullOptionArrayDetermines if an array is a flat array of FullOption.
isFullOptionGroupArrayDetermines if a FlexibleOptionList is a OptionGroup array of FullOption.
isOptionGroupArrayDetermines if an OptionList is an OptionGroup array.
prepareOptionListNormalizes any accepted option list shape—array, option groups, or a record—into a FullOptionList, applying baseOption properties and (when autoSelectOption is false) a leading placeholder option. Also returns the flattened lookup map and the option that should be selected by default.
resolveDefaultOperatorResolves the default operator for a field, applying the same precedence as the QueryBuilder component: the field's own defaultOperator, then the getDefaultOperator option (a string or a function), then the first available operator.
resolveOperatorListResolves the operator list for a field, applying the same precedence as the QueryBuilder component: the field's own operators, then the getOperators callback, then the query-level operator list.
resolveValueEditorTypeResolves the value editor type for a field/operator pair, applying the same precedence as the QueryBuilder component: the field's own valueEditorType (a string or a function of the operator), then the getValueEditorType callback, then "text".
resolveValueListResolves the value option list for a field/operator pair, applying the same precedence as the QueryBuilder component: the field's own values, then the getValues callback, then an empty list.
toFlatOptionArrayFlattens FlexibleOptionGroup arrays into BaseOption arrays. If the array is already flat, it is returned as is.
toFullOptionConverts an Option or ValueOption (i.e., BaseOption) into a FullOption. Full options are left unchanged.
toFullOptionListConverts an OptionList or FlexibleOptionList into a FullOptionList. Lists of full options are left unchanged.
toFullOptionMapConverts a FlexibleOptionList into a FullOptionList. Lists of full options are left unchanged.
toOptionsGenerates an array of <option> or <optgroup> elements from a given OptionList.
uniqByIdentifierGenerates a new array of objects with duplicates removed based on the identifying property (value or name)
uniqByName-
uniqOptGroupsGenerates a new OptionGroup array with duplicates removed based on the identifying property (value or name).
uniqOptListGenerates a new Option or OptionGroup array with duplicates removed based on the identifier property (value or name).

Query Tools

NameDescription
QueryManagerStateful wrapper around the add/remove/update/move/ insert/group query tools, plus rule/group factories, * validation, and formatting.
QueryManagerErrorThrown by QueryManager methods in strict mode when an operation cannot be carried out because its target could not be used.
AbortInfoDetails about an aborted query tool operation.
AbortOptionsOptions for reporting aborted query tool operations.
AddOptionsOptions for add.
GroupOptionsOptions for group.
GuardOptionsOptions that block a mutation before it is attempted.
InsertOptionsOptions for insert.
MoveOptionsOptions for move.
QueryActionCallbacksConfirmation callbacks invoked before a mutation is applied. Their return values are interpreted differently depending on the operation:
QueryActionHandlersThe six mutations a query builder performs. Each takes the current query and returns the next one, or undefined when the mutation was aborted—because the target is disabled, a confirmation callback declined, or a depth limit was reached.
QueryActionsConfigConfiguration for createQueryActions.
QueryManagerOptionsOptions for QueryManager. Mirrors the subset of QueryBuilder props that affect query structure rather than rendering, so the same configuration objects can drive both.
QueryNodeA single rule or group encountered by QueryManager.walk, along with where it was found.
QueryToolOptionsOptions shared by every query tool.
RemoveOptionsOptions for remove.
StrictOptionsPer-call overrides for QueryManager's abort handling. Every mutating method accepts these alongside the options of the query tool it delegates to.
SubscriptionChangeWhat changed in the notification a QueryManager.subscribe listener is receiving.
UpdateOptionsOptions for update.
WalkOptionsOptions for QueryManager.walk and its derivatives.
AbortReasonWhy a query tool returned the query unmodified. Query tools never throw; when they cannot carry out an operation they return the original query and report the reason through AbortOptions.onAbort.
DefaultFieldPropThe getDefaultField option: either a field name or a function that picks one.
DefaultOperatorPropThe getDefaultOperator option: either an operator name or a function that picks one.
addAdds a rule or group to a query without mutating the original query.
addInPlaceAdds a rule or group to a query in place.
groupCreates a new group at a target path with its rules array containing the current objects at the target path and the source path without mutating the original query. In the options parameter, pass { clone: true } to copy the source rule/group instead of move.
groupInPlaceCreates a new group at a target path with its rules array containing the current objects at the target path and the source path in place. In the options parameter, pass { clone: true } to copy the source rule/group instead of move.
insertInserts a rule or group into a query without mutating the original query.
insertInPlaceInserts a rule or group into a query in place.
moveMoves a rule or group from one path to another without mutating the original query. In the options parameter, pass { clone: true } to copy instead of move.
moveInPlaceMoves a rule or group from one path to another in place. In the options parameter, pass { clone: true } to copy instead of move.
removeRemoves a rule or group from a query without mutating the original query.
removeInPlaceRemoves a rule or group from a query in place.
setAutoFreezeGlobally enables or disables immer's auto-freeze, i.e. the deep freeze applied to every query returned by add, update, remove, move, insert, and group.
strictAbortReasonsAbort reasons that QueryManager's strict mode treats as errors. The remaining reasons—"same-location" and "no-change"—describe valid operations that had nothing to do, so they are reported to onInvalidTarget but never throw.
updateUpdates one or more properties of a rule or group within a query without mutating the original query. Properties may be supplied individually (prop, value), as parallel arrays (props, values), or as a property-to-value map. For multi-property updates, field, operator, and valueSource are applied before value, so an explicit value is never reset by a change to one of those properties.
updateInPlaceUpdates one or more properties of a rule or group within a query in place. See update for the supported argument forms and ordering semantics.
convertFromICConverts a RuleGroupTypeIC to RuleGroupType.
convertQueryConverts a RuleGroupType to RuleGroupTypeIC. For a more explicit operation, use convertToIC.
convertToICConverts a RuleGroupType to RuleGroupTypeIC.
createQueryActionsBuilds the query builder's six mutation handlers as pure functions of the current query.
createRuleCreates a rule from the given configuration, applying the same precedence as the QueryBuilder component. The value is computed in a second pass, once field, operator, and valueSource are known, since the default value depends on all three.
createRuleGroupCreates a group from the given configuration. Pass true for independentCombinators to omit the combinator property.
deriveQueryBuilderClassNamesThe outer (wrapper) classname for the query builder itself, including the conditional disabled, valid, and invalid state classes.
deriveRuleClassNameThe classname for a single element of a rule, composed from the same table as deriveRuleClassNames. Useful where only one is needed, such as the items of a multi-value editor.
deriveRuleClassNamesClassnames for each element rendered by a rule. This is the framework-agnostic core of the classNames object returned by the useRule hook.
deriveRuleContextResolves everything about a single rule that depends on the field/operator configuration: its field data, operators, value editor type, value list, value sources, match modes, and validation result.
deriveRuleGroupClassNamesClassnames for each element rendered by a rule group, including its conditionally-classed header. This is the framework-agnostic core of the classNames object returned by the useRuleGroup hook.
deriveRuleGroupContextResolves everything about a rule group that depends on the combinator configuration, plus its validation result.
deriveRuleGroupOuterClassNameThe outer (wrapper) classname for a rule group, including every conditional state class.
deriveRuleOuterClassNameThe outer (wrapper) classname for a rule, including every conditional state class.
exceedsMaxLevelsWhether adding a group beneath parentPath would exceed maxLevels.
getGuardAbortReasonWhether a mutation targeting pathOrID is blocked by the given guards, and why. Returns null when the mutation may proceed.
resolveCandidateQueryResolves the query a query builder should render from the available sources, in precedence order: the controlled query, then whatever is already in the store, then the uncontrolled defaultQuery, then a freshly created empty group.

Functions

FunctionDescription
bigIntJsonParseReviver"Reviver" method for JSON.parse's second argument. Converts objects having a single $bigint: string property to an actual bigint value.
bigIntJsonStringifyReplacer"Replacer" method for JSON.stringify's second argument. Converts bigint values to objects with a $bigint property having a value of a string representation of the actual bigint-type value.
clsx-
findIDReturns the RuleType or RuleGroupType/RuleGroupTypeIC with the given id within a query.
findPathReturns the RuleType or RuleGroupType/RuleGroupTypeIC at the given path within a query.
generateIDDefault id generator. Generates a valid v4 UUID. Uses crypto.randomUUID() when available, otherwise uses an alternate method based on getRandomValues. The returned string is guaranteed to match this regex: /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i
getCommonAncestorPathFinds the deepest/longest path that two paths have in common.
getCompatContextProviderGenerates a context provider for a compatibility package.
getDispatchQueryByIdReturns the dispatchQuery function for the query builder with the given qbId, or undefined if no such query builder is mounted.
getFieldDataResolves the field configuration for a rule's field, falling back to a minimal option object when the field isn't present in the field map.
getMatchModesUtilUtility function to get the match modes array for the given field. If the field definition does not define a matchModes property, the getMatchModes prop is used. Returns FullOption<MatchMode>[] of all match modes by default.
getParametersAsListNormalizes the result of getParameters to a non-empty list or null.
getParentPathTruncates the last element of an array and returns the result as a new array.
getParseNumberMethod-
getPathOfIDReturns the Path of the RuleType or RuleGroupType/RuleGroupTypeIC with the given id within a query.
getQuerySelectorByIdGiven a qbId (passed to every component as part of the schema prop), returns a Redux selector for use with useQueryBuilderSelector.
getRqbStoreGets the singleton React Query Builder store instance. DevTools are enabled if either: - globalThis.RQB_DEVTOOLS is truthy - window.RQB_DEVTOOLS is truthy
getRuleGroupCombinatorThe effective combinator for a group: its own combinator when it has one, otherwise the first configured combinator (which is the case for groups with independent combinators).
getRuleInputTypeThe input type for a rule. A field's own inputType takes precedence over getInputType.
getRuleValidationResultThe validation result for a rule: the entry from a query-level ValidationMap if present, otherwise the field's own validator result, otherwise null.
getRuleValueEditorTypeThe value editor type for a rule. valueSource: "field" always uses a select list, and valueSource: "parameter" uses a (multi)select when parameters are available.
getRuleValuesThe option list presented by a rule's value editor, resolved from its valueSource.
getRuleValueSourceOptionsValue source options for a rule. A valueSource present on the rule but absent from the configured list is appended, so the current selection is always representable.
getValidationClassNamesGets the standard classname for valid or invalid components based on the given validation result.
getValueSourcesUtilUtility function to get the value sources array for the given field and operator. If the field definition does not define a valueSources property, the getValueSources prop is used. Returns [FullOption<"value">] by default.
hideValueControlsForOperatorWhether the value editor(s) should be hidden for an operator, based on its arity.
injectSliceInjects a slice into the React Query Builder store. Useful for extensions that need to integrate their own state management.
isAncestorDetermines if the first path is an ancestor of the second path. The first path must be shorter and exactly match the second path up through the length of the first path.
isPojoDetermines if a variable is a plain old JavaScript object, aka POJO.
isRuleGroupDetermines if an object is a RuleGroupType or RuleGroupTypeIC.
isRuleGroupTypeDetermines if an object is a RuleGroupType.
isRuleGroupTypeICDetermines if an object is a RuleGroupTypeIC.
isRuleOrGroupValidDetermines if a rule or group is valid based on a validation result (if defined) or a validator function. Returns true if neither are defined and the muted property is not true.
isRuleTypeDetermines if an object is a RuleType (only checks for a field property).
isUnsafeKeyReturns true if the key could cause prototype pollution when used as a property name in bracket-notation assignment.
isValidationResultDetermines if an object is useful as a validation result.
joinWithJoins an array of strings using the given character (see defaultJoinChar). When the given character appears in an array element, a backslash will be added just before it to distinguish it from the join character. Effectively the inverse of splitBy.
lcConverts a value to lowercase if it's a string, otherwise returns the value as is.
mergeAnyTranslation-
mergeAnyTranslationsMerges any number of partial translations into a single definition.
mergeClassnamesMerges a list of partial Classnames definitions into a single definition.
mergeTranslation-
mergeTranslationsMerges any number of partial Translations into a single definition.
nullFreeArrayDetermines if an array is free of null/undefined.
nullOrUndefinedOrEmptySimple helper to determine whether a value is null, undefined, or an empty string.
optionsEqualWhether two QueryManagerOptions objects describe the same configuration, per valuesEqual: data by value, functions by identity.
parseNumberConverts a string to a number. Uses native parseFloat if parseNumbers is "native", otherwise uses numeric-quantity. If that returns NaN, the string is returned unchanged. Numeric values are returned as-is regardless of the parseNumbers option.
pathIsDisabledDetermines if the rule or group at the specified path is either disabled itself or disabled by an ancestor group.
pathsAreEqualDetermines if two paths (each Path) are equivalent.
preferAnyPropFor given default, prop, and context values, return the first provided of prop, context, and default, in that order.
preferFlagPropsFor a given set of defaults, props, and context values, return the first provided of prop, context, and default—in that order—for each property in the defaults object.
preferPropFor given default, prop, and context values, return the first provided of prop, context, and default, in that order.
prepareRuleEnsures that a rule is valid by adding an id property if it does not already exist.
prepareRuleGroupEnsures that a rule group is valid by recursively adding an id property to the group itself and all its rules and subgroups where one does not already exist.
prepareRuleOrGroupEnsures that a rule or group is valid. See prepareRule and prepareRuleGroup.
processMatchModeTransforms - match: { mode: "atLeast", threshold: 1 } to match: { mode: "some" } - match: { mode: "atMost", threshold: 0 } to match: { mode: "none" }.
regenerateIDGenerates a new id property for a rule.
regenerateIDsRecursively generates new id properties for a rule group and all its rules and subgroups.
shouldCoalesceDetermines whether a change should be absorbed into the current history entry instead of pushing a new one. This is the exact rule QueryManager applies when recording history, exposed so non-React implementations can manage their own history stacks without reimplementing (and drifting from) the semantics.
signatureOfDescribes what changed between two versions of a query as a short string, so that consecutive edits to the same property of the same rule (e.g. typing in a value editor) can be recognized and coalesced into a single history entry.
splitBySplits a string by a given character (see defaultJoinChar). Escaped characters (characters preceded by a backslash) will not apply to the split, and the backslash will be removed in the array element. Inverse of joinWith.
toArraySplits a string by comma then trims each element. Arrays are returned as is except any string elements are trimmed.
transformQueryRecursively process a query heirarchy using this versatile utility function.
trimIfStringTrims the value if it is a string. Otherwise returns the value as is.
useFields-
useMatchModeEditor-
usePathsMemo-
valuesEqualStructural equality for QueryManagerOptions values. Arrays and plain objects are compared by value; everything else — functions, class instances, Maps, Dates — by identity.

Interfaces

InterfaceDescription
AddMethod-
ClassnameConditionA classname applied only when when returns true for the current state.
ClassnameSpecHow one derived classname is composed: the controlClassnames keys that contribute to it (in application order, after the standard classname), plus any state-dependent classes.
CommonRuleAndGroupPropertiesProperties common to both rules and groups.
CreateRuleGroupOptionsEverything createRuleGroup needs to produce a new group.
CreateRuleOptionsEverything createRule needs to produce a new rule. Each member corresponds to the QueryBuilder prop (or useQueryBuilderSetup output) of the same name.
DefaultRuleGroupTypeICRuleGroupTypeIC with combinators limited to DefaultCombinatorName and rules limited to DefaultRuleType.
DeriveClassNamesOptionsOptions common to every classname derivation.
DndClassNameStateDrag-and-drop state that can contribute conditional classnames.
DragCollection-
DropCollection-
DropResult-
GetRuleDefaultValueOptionsOptions for getRuleDefaultValue.
GroupMethod-
InsertMethod-
LazyLoadedSlices-
MatchConfigQuantification mode describing how many elements of the value array must pass the filter for the rule itself to pass.
MoveMethod-
OuterClassNameOptionsInputs to deriveRuleOuterClassName and deriveRuleGroupOuterClassName.
OuterClassNameOptionsBaseInputs common to every outer (wrapper) classname derivation.
ParseNumberOptionsOptions object for parseNumber.
PathInfoThe path of a child rule or group, and whether it is disabled.
PreparedOptionListResult of prepareOptionList.
PrepareOptionListParamsParameters for prepareOptionList.
PreparerOptionsOptions for prepareRule/prepareRuleGroup.
QueryBuilderClassNameStateState that contributes conditional classnames to the query builder's wrapper element.
QueryBuilderFlags-
QueryHistoryOptionsOptions controlling how query changes are recorded for undo/redo.
RegenerateIdOptionsOptions object for regenerateID/regenerateIDs.
RemoveMethod-
ResolveOptionListOptionsOptions shared by the resolvers below that produce a normalized option list.
RqbState-
RuleClassNameStateState that contributes conditional classnames to a rule's wrapper element.
RuleContextEverything deriveRuleContext resolves for a single rule.
RuleContextResolversFunctions used by deriveRuleContext to resolve a rule's configuration. Each corresponds to the QueryBuilder prop (or useQueryBuilderSetup output) of the same name.
RuleGroupContextEverything deriveRuleGroupContext resolves for a single rule group.
RuleGroupTypeThe main rule group type. This type is used for query definitions as well as all sub-groups of queries.
RuleGroupTypeICThe main rule group interface when using independent combinators. This type is used for query definitions as well as all sub-groups of queries.
RuleTypeThe main rule type. The field, operator, and value properties can be narrowed with generics.
TransformQueryOptionsOptions object for index!transformQuery transformQuery.
UpdateMethodUpdates a single property of a rule or group.
UseControlledOrUncontrolledParams-
UseFields-
UseMatchModeEditor-
UseOptionListPropResult of prepareOptionList.
UseOptionListPropParamsParameters for prepareOptionList.
UseQbId-
UseRuleDnDReturn type of @react-querybuilder/dnd!useRuleDnD hook.
UseRuleGroupDnDReturn type of @react-querybuilder/dnd!useRuleGroupDnD hook.
UseSelectElementChangeHandlerParams-
UseValueEditor-
ValidationResultObject with a valid boolean value and optional reasons.

Type Aliases

Type AliasDescription
AccessibleDescriptionGeneratorSignature of accessibleDescriptionGenerator prop, used by QueryBuilder to generate accessible descriptions for each RuleGroup.
ActionElementEventHandler-
ArityAllowed values of the FullOperator property arity. A value of "unary" or a number less than two will cause the default ValueEditor to render null.
ClassnameString of classnames, array of classname strings, or object where the keys are classnames and those with truthy values will be included. Suitable for passing to the clsx package.
DefaultCombinators-
DefaultCombinatorsExtended-
DefaultMatchModes-
DefaultOperators-
DefaultRuleGroupArrayThe type of the rules array in a DefaultRuleGroupType.
DefaultRuleGroupICArrayThe type of the rules array in a DefaultRuleGroupTypeIC.
DefaultRuleGroupTypeRuleGroupType with the combinator property limited to DefaultCombinatorNameExtended and rules limited to DefaultRuleType.
DefaultRuleGroupTypeAnyShorthand for "either DefaultRuleGroupType or DefaultRuleGroupTypeIC".
DefaultRuleOrGroupArrayShorthand for "either DefaultRuleGroupArray or DefaultRuleGroupICArray".
DefaultRuleTypeRuleType with the operator property limited to DefaultOperatorName.
DispatchQueryFn-
DndDropTargetType-
DraggedItem-
DropEffect-
ExpressionNodeA single node in an expression tree. Expressions are recursive: a func node's arguments are themselves ExpressionNodes, enabling arbitrary nesting.
FindPathReturnTypeReturn type for findPath.
GenericizeRuleGroupTypeConverts a narrowed rule group type to its most generic form.
GetCompatContextProviderProps-
GetRuleGroupTypeDetermines if a type extending RuleGroupTypeAny is actually RuleGroupType or RuleGroupTypeIC.
GetRuleTypeFromGroupWithFieldAndOperatorDetermines the RuleType of a given RuleGroupType or RuleGroupTypeIC. If the field and operator name types of the rule type extend the identifier types of the provided Field and Operator types, the given rule type is returned as is. Otherwise, the rule type has its field and operator types narrowed to the identifier types of the provided Field and Operator types.
InputTypeHTML5 input types
JsonLogicAll-
JsonLogicAnd-
JsonLogicDoubleNegation-
JsonLogicEqual-
JsonLogicGreaterThan-
JsonLogicGreaterThanOrEqual-
JsonLogicInArray-
JsonLogicInString-
JsonLogicLessThan-
JsonLogicLessThanOrEqual-
JsonLogicNegation-
JsonLogicNone-
JsonLogicNotEqual-
JsonLogicOr-
JsonLogicReservedOperations-
JsonLogicRulesLogic-
JsonLogicSome-
JsonLogicStrictEqual-
JsonLogicStrictNotEqual-
JsonLogicVar-
MatchMode-
MatchModeOptions-
ParseNumberMethodParsing algorithms used by parseNumber.
ParseNumbersPropConfigOptions for the parseNumbers prop of QueryBuilder.
Path-
QueryValidatorFunction that validates a query.
RemoveNullabilityUtility type to make all properties non-nullable.
RqbStore-
RuleClassnameKeyKeys of the classNames object returned for a rule.
RuleFacetThe subset of a rule that determines its configuration. Accepting only these properties (rather than the whole rule) lets React callers keep granular memoization dependencies, so editing a rule's value doesn't recompute its operators, value sources, or option lists.
RuleGroupArrayThe type of the rules array in a RuleGroupType.
RuleGroupClassnameKeyKeys of the classNames object returned for a rule group.
RuleGroupICArrayThe type of the rules array in a RuleGroupTypeIC.
RuleGroupTypeAnyShorthand for "either RuleGroupType or RuleGroupTypeIC".
RuleOrGroupArrayShorthand for "either RuleGroupArray or RuleGroupICArray".
RuleValidatorFunction that validates a rule.
StringUnionToFlexibleOptionArray-
StringUnionToFullOptionArray-
ToRuleGroupTypeConverts a RuleGroupTypeIC extension to the corresponding RuleGroupType type, preserving any additional properties. If the type already extends RuleGroupType (non-IC), it is returned as-is.
ToRuleGroupTypeICConverts a RuleGroupType extension to the corresponding RuleGroupTypeIC type, preserving any additional properties. If the type already extends RuleGroupTypeIC, it is returned as-is.
UpdateablePropertiesAll updateable properties of rules and groups (everything except id, path, and rules).
UpdateValueMapA map of UpdateableProperties to their new values, for updating multiple properties of a rule or group in a single operation.
UseMergedContextParams-
UseQueryBuilderSchema-
UseQueryBuilderSetup-
UseValueSelectorParams-
ValidationMapMap of rule/group id to its respective ValidationResult.
ValueChangeEventHandler-
ValueEditorTypeType of ValueEditor that will be displayed.
ValueSourceA source for the value property of a rule.
ValueSourceFlexibleOptions-
ValueSourceFullOptions-
ValueSourcesA valid array of potential value sources.
WithRequiredUtility type to make one or more properties required.
WithUnknownIndexAdds an unknown index property to an interface.

Variables

VariableDescription
defaultCombinatorLabelMap-
defaultOperatorLabelMap-
defaultValidatorThis is an example validation function you can pass to QueryBuilder in the validator prop. It assumes that you want to validate groups, and has a no-op for validating rules which you can replace with your own implementation.
LogType-
messages-
numericRegexRegex matching numeric strings. Passes for positive/negative integers, decimals, and E notation, with optional surrounding whitespace.
objectEntriesA strongly-typed version of Object.entries().
objectKeysA strongly-typed version of Object.keys().
QueryBuilderContextContext provider for QueryBuilder. Any descendant query builders will inherit the props from a context provider.
QueryBuilderStateContext-
queryBuilderStore-
structuralSignatureSignature returned when a change alters the shape of the query—rules or groups added, removed, moved, or reordered—rather than the properties of a single node. Structural changes never coalesce with each other, so each one produces its own history entry.
subqueryElementAliasBaseBase alias assigned to the element binding of a subquery generated for a rule's `match` mode (e.g. unnest(field) as elem_alias).
unchangedSignatureSignature returned when two queries differ by reference only, with no observable difference in their properties.
uuidV4regex-

Accessibility

VariableDescription
generateAccessibleDescriptionThe default accessibleDescriptionGenerator. Produces the aria-label for a rule group: "Query builder" for the root group, "Rule group at path 0-1" for any other.

Paths

FunctionDescription
derivePathInfoBuilds the PathInfo for each child of a group at path. A child is disabled if its parent is disabled or if its own path appears in disabledPaths.
pathIsDisabledByPathsDetermines if the rule or group at the specified path is disabled by disabledPaths—the array form of the QueryBuilder disabled prop, which disables nodes by position rather than by a disabled property on the node itself. A path is disabled if it appears in disabledPaths or descends from a path that does.

default

Renames and re-exports QueryBuilder


Value Editors

FunctionDescription
coerceBigIntValueCoerces a value to a bigint, falling back to the parsed number when it can't be represented as one (an empty string or a decimal, for example).
coerceInputTypeThe type attribute an <input> should use for a rule. bigint values and the in/notIn operators (whose value is a comma-separated list) both require a text input.
getMultiValueUpdateProduces the next value for a series of value editors when the editor at index changes.
getValueEditorResetDetermines whether a rule's value needs to be collapsed to a single element because it no longer represents a list, and what it should become.
getValueSelectorUpdateProduces the next value for a value selector. Multiselect values are normalized to an array first, then comma-joined unless listsAsArrays is true. Single-select values pass through.
isBetweenOperatorWhether an operator's value is a list of two bounds.
normalizeValueSelectorValueNormalizes a value selector's current value for display. Multiselect values become an array of strings so they match option names, which are always strings (e.g. [42] becomes ["42"]).

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.