react-querybuilder
Components
| Name | Description |
|---|---|
| QueryBuilderContextProvider | - |
| DragHandle | Default drag handle component used by QueryBuilder when enableDragAndDrop is true. |
| Rule | Default component to display RuleType objects. This is actually a small wrapper around RuleComponents. |
| RuleComponents | Renders a React.Fragment containing an array of form controls for managing a RuleType. |
| RuleComponentsWithSubQuery | - |
| RuleGroup | Default component to display RuleGroupType and RuleGroupTypeIC objects. This is actually a small wrapper around RuleGroupHeaderComponents and RuleGroupBodyComponents. |
| RuleGroupBodyComponents | Renders a React.Fragment containing an array of either (1) Rule and RuleGroup, or (2) Rule, RuleGroup, and InlineCombinator. |
| RuleGroupHeaderComponents | Renders a React.Fragment containing an array of form controls for managing a RuleGroupType or RuleGroupTypeIC. |
| ActionElement | Default <button> component used by QueryBuilder. |
| InlineCombinator | Default inlineCombinator component used by QueryBuilder. A small <div> wrapper around the combinatorSelector component, used when either showCombinatorsBetweenRules or independentCombinators are true. |
| MatchModeEditor | Default matchModeEditor component used by QueryBuilder. |
| NotToggle | Default notToggle (aka inversion) component used by QueryBuilder. |
| QueryBuilder | The query builder component for React. |
| QueryBuilderStateProvider | Context provider for the {@link QueryBuilder} state store. |
| RuleWithSubQueryGroupComponentsWrapper | - |
| ShiftActions | Default "shift up"/"shift down" buttons used by QueryBuilder. |
| ValueEditor | Default valueEditor component used by QueryBuilder. |
| ValueSelector | Default <select> component used by QueryBuilder. |
Props
| Name | Description |
|---|---|
| ActionProps | Props passed to every action component (rendered as <button> by default). |
| Props passed to every action component that adds a rule or group. | |
| Props passed to every group action component. | |
| BaseTranslation | A translation for a component with title only. |
| BaseTranslations | The shape of the translations prop. |
| BaseTranslationWithLabel | A translation for a component with title and label. |
| BaseTranslationWithPlaceholders | A translation for a component with title and a placeholder. |
| Classnames | Classnames applied to each component. |
| CombinatorSelectorProps | Props for combinatorSelector components. |
| CommonRuleSubComponentProps | Base interface for all rule subcomponents. |
| CommonSubComponentProps | Base interface for all subcomponents. |
| DragHandleProps | Props for dragHandle components. |
| FieldSelectorProps | Props for fieldSelector components. |
| InlineCombinatorProps | Props passed to inlineCombinator components. |
| MatchModeEditorProps | Props for matchModeEditor components. |
| NotToggleProps | Props for notToggle components. |
| OperatorSelectorProps | Props for operatorSelector components. |
| Placeholder | Placeholder strings for option lists. |
| QueryActions | Functions included in the actions prop passed to every subcomponent. |
| QueryBuilderContextProps | Props passed down through context from a QueryBuilderContextProvider. |
| QueryBuilderContextProviderProps | - |
| RuleGroupProps | RuleGroup props. |
| RuleProps | Rule props. |
| Schema | Configuration options passed in the schema prop from QueryBuilder to each subcomponent. |
| SelectorOrEditorProps | Base interface for selectors and editors. |
| ShiftActionsProps | Props passed to shiftActions components. |
| Translation | A translation for a component with title only. |
| Translations | The shape of the translations prop. |
| TranslationWithLabel | A translation for a component with title and label. |
| TranslationWithPlaceholders | A translation for a component with title and a placeholder. |
| UndoRedoActionsProps | Props passed to undoRedoActions components. |
| UseMergedContext | Props passed down through context from a QueryBuilderContextProvider. |
| UseRule | Rule props. |
| UseRuleGroup | RuleGroup props. |
| ValueEditorProps | Props passed to valueEditor components. |
| ValueSelectorProps | Props for all value selector components. |
| ValueSourceSelectorProps | Props for valueSourceSelector components. |
| BaseTranslationsFull | The full translations interface with all properties required. |
| ControlElementsProp | Subcomponents. |
| ControlKey | The name of a query builder control. |
| Controls | All subcomponents. |
| QueryBuilderProps | Props for QueryBuilder. |
| TranslationsFull | The full translations interface with all properties required. |
| VersatileSelectorProps | Utility type representing props for selector components that could potentially be any of the standard selector types. |
| controlKeys | The name of every query builder control, alphabetized. |
| controlKind | Which 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. |
| controlPropKeys | The 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
| Name | Description |
|---|---|
| useQueryBuilderSelector | A Redux useSelector hook for RQB's internal store. See also getQuerySelectorById. |
| useControlledOrUncontrolled | Logs a warning when the component changes from controlled to uncontrolled, vice versa, or both query and defaultQuery are provided. |
| useDeprecatedProps | Logs 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) |
| useMergedContext | Merges inherited context values with props, giving precedence to props. |
| - | |
| usePreferAnyProp | For given default, prop, and context values, return the first provided of prop, context, and default, in that order. |
| usePreferProp | For given default, prop, and context values, return the first provided of prop, context, and default, in that order. |
| usePrevious | Returns the prop value from the last render. |
| useQbId | Manages the qbId for a QueryBuilder instance. |
| useQueryBuilder | Calls 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. |
| useQueryBuilderQuery | Retrieves the full, latest query object for the nearest ancestor QueryBuilder component. |
| useQueryBuilderSchema | For given QueryBuilderProps and setup values from useQueryBuilderSetup, prepares and returns all values required to render a query builder. |
| useQueryBuilderSetup | Massages the props as necessary and prepares the basic update/generate methods for use by the QueryBuilder component. |
| useQueryManager | Subscribes to a QueryManager and returns its current query alongside the manager itself. The component re-renders whenever the query changes. |
| useReactDndWarning | Logs 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. |
| useRule | Prepares all values and methods used by the Rule component. |
| useRuleGroup | Prepares all values and methods used by the RuleGroup component. |
| useSelectElementChangeHandler | Returns a memoized change handler for HTML <select> elements. |
| useStopEventPropagation | Wraps 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. |
| useUndoRedoWarning | Logs 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. |
| useValueEditor | This hook is primarily concerned with multi-value editors like date range pickers, editors for 'in' and 'between' operators, etc. |
| useValueSelector | Transforms a value into an array when appropriate and provides a memoized change handler. |
Export
| Name | Description |
|---|---|
| DiagnosticEntry | A single diagnostic entry produced by the "diagnostics" format. |
| DiagnosticsFieldSummaryEntry | Per-field summary entry for the "diagnostics" format. |
| DiagnosticsResult | Top-level result of formatQuery for the "diagnostics" format. |
| DiagnosticsStats | Aggregate statistics for the "diagnostics" format. |
| DrizzleOperatorsLike | Minimal 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.) |
| FormatQueryFinalOptions | Options object curated by formatQuery and passed to a RuleGroupProcessor. |
| FormatQueryOptions | Options object shape for formatQuery. |
| ParameterizedNamedSQL | Object produced by formatQuery for the "parameterized_named" format. |
| ParameterizedSQL | Object produced by formatQuery for the "parameterized" format. |
| RQBJsonLogicEndsWith | - |
| RQBJsonLogicStartsWith | - |
| RQBJsonLogicVar | - |
| RuleGroupDiagnosticsResult | A RuleGroupType annotated with diagnostics results, as produced by formatQuery for the "diagnostics" format. |
| RuleGroupICDiagnosticsResult | A RuleGroupTypeIC annotated with diagnostics results, as produced by formatQuery for the "diagnostics" format (independent combinators). |
| SequelizeWhereOptionsLike | Structural 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 }). |
| ValueProcessorOptions | Options object for ValueProcessorByRule functions. |
| ConstituentWordOrder | Constituent word order (as array) for the "natural_language" format. |
| ConstituentWordOrderString | Constituent word order (as string) for the "natural_language" format. |
| DrizzleWhereCallback | Return 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. |
| ExportFormat | Available export formats for formatQuery. |
| ExportObjectFormats | Export formats for formatQuery that produce objects instead of strings. |
| ExportOperatorMap | A 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. |
| FormatQueryValidateRule | Rule validator for formatQuery. |
| GroupVariantCondition | Rule group condition identifier for the "natural_language" format. |
| NLTranslationKey | Keys for the translations config object used by the "natural_language" format. |
| NLTranslations | translations config object for "natural_language" format. |
| RQBJsonLogic | JsonLogic rule object with additional operators generated by formatQuery and accepted by parseJsonLogic!parseJsonLogic. |
| RuleDiagnosticsResult | A RuleType annotated with diagnostics results, as produced by formatQuery for the "diagnostics" format. |
| RuleGroupDiagnosticsArray | The type of the rules array in a RuleGroupDiagnosticsResult. |
| RuleGroupICDiagnosticsArray | The type of the rules array in a RuleGroupICDiagnosticsResult. |
| RuleGroupProcessor | Function to produce a result that formatQuery uses when processing a RuleGroupType or RuleGroupTypeIC object. |
| RuleProcessor | Function to produce a result that formatQuery uses when processing a RuleType object. |
| SQLPreset | Available presets for the "sql" export format. |
| ValueProcessor | - |
| ValueProcessorByRule | Function that produces a processed value for a given RuleType. |
| ValueProcessorLegacy | Function that produces a processed value for a given field, operator, value, and valueSource. |
| celCombinatorMap | Maps a DefaultCombinatorName to a CEL combinator. |
| cypherCombinatorMap | Maps a DefaultCombinatorName to a Cypher combinator keyword. |
| - | |
| defaultExportOperatorMap | Default operator map used by formatQuery for "natural_language" format. |
| - | |
| defaultNLTranslations | Default translations used by formatQuery for "natural_language" format. |
| defaultOperatorProcessorNL | Default operator processor used by formatQuery for "natural_language" format. |
| defaultOperatorProcessorSQL | Default operator processor used by formatQuery for "sql" and "parameterized*" formats. |
| defaultRuleGroupProcessorCEL | Rule group processor used by formatQuery for "cel" format. |
| defaultRuleGroupProcessorCypher | Rule group processor used by formatQuery for "cypher" and "gql" formats. |
| defaultRuleGroupProcessorDiagnostics | Rule group processor used by formatQuery for "diagnostics" format. |
| defaultRuleGroupProcessorDrizzle | Default 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. |
| defaultRuleGroupProcessorElasticSearch | Rule group processor used by formatQuery for "elasticsearch" format. |
| defaultRuleGroupProcessorGremlin | Rule group processor used by formatQuery for "gremlin" format. |
| defaultRuleGroupProcessorJSONata | Rule group processor used by formatQuery for "jsonata" format. |
| defaultRuleGroupProcessorJsonLogic | Rule group processor used by formatQuery for "jsonlogic" format. |
| defaultRuleGroupProcessorLDAP | Rule group processor used by formatQuery for "ldap" format. |
| defaultRuleGroupProcessorMongoDB | Rule group processor used by formatQuery for "mongodb" format. |
| defaultRuleGroupProcessorMongoDBQuery | Rule group processor used by formatQuery for "mongodb_query" format. |
| defaultRuleGroupProcessorNL | Rule group processor used by formatQuery for "natural_language" format. |
| defaultRuleGroupProcessorParameterized | Rule group processor used by formatQuery for "parameterized" and "parameterized_named" formats. |
| defaultRuleGroupProcessorPrisma | Rule group processor used by formatQuery for "prisma" format. |
| defaultRuleGroupProcessorSequelize | Rule group processor used by formatQuery for "sequelize" format. |
| defaultRuleGroupProcessorSPARQL | Rule group processor used by formatQuery for "sparql" format. |
| defaultRuleGroupProcessorSpEL | Default rule processor used by formatQuery for "spel" format. |
| defaultRuleGroupProcessorSQL | Default rule processor used by formatQuery for "sql" format. |
| defaultRuleGroupProcessorTanStackDB | Default rule group processor used by formatQuery for the "tanstack_db" format. Returns a WhereCallback suitable for TanStack DB's .where() method. |
| defaultRuleProcessorCEL | Default rule processor used by formatQuery for "cel" format. |
| defaultRuleProcessorCypher | Default rule processor used by formatQuery for "cypher" and "gql" formats. |
| defaultRuleProcessorDrizzle | Default rule processor used by formatQuery for the "drizzle" format. |
| defaultRuleProcessorElasticSearch | Default rule processor used by formatQuery for "elasticsearch" format. |
| defaultRuleProcessorGremlin | Default rule processor used by formatQuery for "gremlin" format. |
| defaultRuleProcessorJSONata | Default rule processor used by formatQuery for "jsonata" format. |
| defaultRuleProcessorJsonLogic | Default rule processor used by formatQuery for "jsonlogic" format. |
| defaultRuleProcessorLDAP | Default rule processor used by formatQuery for "ldap" format. |
| defaultRuleProcessorMongoDB | Default rule processor used by formatQuery for "mongodb" format. |
| defaultRuleProcessorMongoDBQuery | Default rule processor used by formatQuery for "mongodb_query" format. |
| defaultRuleProcessorNL | Default rule processor used by formatQuery for "natural_language" format. |
| defaultRuleProcessorParameterized | Default rule processor used by formatQuery for "parameterized" and "parameterized_named" formats. |
| defaultRuleProcessorPrisma | Default rule processor used by formatQuery for "prisma" format. |
| defaultRuleProcessorSequelize | Default rule processor used by formatQuery for the "sequelize" format. |
| defaultRuleProcessorSPARQL | Default rule processor used by formatQuery for "sparql" format. |
| defaultRuleProcessorSpEL | Default rule processor used by formatQuery for "spel" format. |
| defaultRuleProcessorSQL | Default rule processor used by formatQuery for "sql" format. |
| defaultRuleProcessorTanStackDB | Default rule processor used by formatQuery for the "tanstack_db" format. |
| - | |
| Default value processor used by formatQuery for "sql" format. | |
| defaultValueProcessorByRule | Default value processor used by formatQuery for "sql" format. |
| - | |
| - | |
| defaultValueProcessorNL | Default value processor used by formatQuery for "natural_language" format. |
| - | |
| formatQueryOptionPresets | A collection of option presets for formatQuery. |
| jsonLogicAdditionalOperators | Register these operators with jsonLogic before applying the result of formatQuery(query, 'jsonlogic'). |
| mongoDbFallback | Default fallback object used by formatQuery for "mongodb_query" format. |
| mongoOperators | Maps a (lowercase) DefaultOperatorName to a MongoDB operator. |
| prismaFallback | Default fallback object used by formatQuery for "prisma" format. |
| prismaOperators | Maps a (lowercase) DefaultOperatorName to a Prisma ORM operator. |
| sqlDialectPresets | A collection of option presets for formatQuery, specifically for SQL-based formats. |
| formatQuery | Generates a formatted (indented two spaces) JSON string from a query object. |
| getLikeWildcards | Returns the [prefix, suffix] LIKE wildcards for a string-match operator (e.g. contains → ['%', '%'], beginsWith → ['', '%'], endsWith → ['%', '']). Unknown operators yield ['', '']. |
| getNLTranslataion | Used by formatQuery to get a translation based on certain conditions for the "natural_language" format. |
| getQuotedFieldName | Given a field name and relevant ValueProcessorOptions, returns the field name wrapped in the configured quote character(s). |
| getQuoteFieldNamesWithArray | Converts the quoteFieldNamesWith option into an array of two strings. If the option is a string, the array elements are both that string. |
| getSQLConcat | Returns 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 |
| getSubqueryElementAlias | Returns 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. |
| isValidValue | Determines whether a value is anything except an empty string or NaN. |
| isValueProcessorLegacy | Used 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. |
| mapSQLOperator | Maps a DefaultOperatorName to a SQL operator. |
| normalizeConstituentWordOrder | Given 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"]). |
| numerifyValues | Returns a new query object with all string-type value properties converted to number where appropriate. |
| shouldRenderAsNumber | Determines 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. |
| sparqlVar | Auto-prefix a SPARQL variable name with ? unless it's already prefixed, a URI, or a prefixed name. |
| stripParamPrefix | Strips a leading paramPrefix from a named-parameter value if present. Inverse of withParamPrefix; used to normalize parameter names for validation/lookup. |
| withParamPrefix | Prefixes 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"). |
| wrapLikeFragment | Wraps 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
| Variable | Description |
|---|---|
| betweenOperators | Range operators (between, notBetween). |
| defaultCoalesceMs | Default time window (in milliseconds) within which consecutive changes to the same property of the same rule are coalesced into a single undo step. |
| defaultCombinators | Default combinator list. |
| defaultCombinatorsExtended | Default combinator list, with XOR added. |
| defaultControlClassnames | Default classnames for each component. |
| defaultControlElements | Default components used by QueryBuilder. |
| defaultJoinChar | Default character used to .join and .split arrays. |
| defaultMatchModes | Default match modes. |
| defaultMaxHistory | Default maximum number of undo steps retained by query history. |
| defaultOperatorNegationMap | Map of default operators to their respective opposite/negating operators. |
| defaultOperators | Default operator list. |
| defaultPlaceholderFieldGroupLabel | Default label for placeholder option group in the fields array. |
| defaultPlaceholderFieldLabel | Default label for placeholder option in the fields array. |
| defaultPlaceholderFieldName | Default name for placeholder option in the fields array. |
| defaultPlaceholderLabel | - |
| defaultPlaceholderName | - |
| defaultPlaceholderOperatorGroupLabel | Default label for placeholder option group in the operators array. |
| defaultPlaceholderOperatorLabel | Default label for placeholder option in the operators array. |
| defaultPlaceholderOperatorName | Default name for placeholder option in the operators array. |
| defaultPlaceholderValueGroupLabel | Default label for placeholder option group in the values array. |
| defaultPlaceholderValueLabel | Default label for placeholder option in the values array. |
| defaultPlaceholderValueName | Default name for placeholder option in the values array. |
| defaultTranslations | Default configuration of translatable strings. |
| groupInvalidReasons | Default reason codes for a group being invalid. |
| inOperators | List-membership operators (in, notIn). |
| nullOperators | Null-check operators (null, notNull). |
| queryBuilderFlagDefaults | Default values for all boolean QueryBuilder options. |
| relationalOperators | Relational/comparison operators (=, !=, <, >, <=, >=). |
| rootPath | The Path of the root group. |
| standardClassnames | Standard classnames applied to each component. |
| substringOperators | Substring/text-matching operators (contains, beginsWith, endsWith, and negations). |
| TestID | Component identifiers for testing. |
Option Lists
| Name | Description |
|---|---|
| BaseOption | Do 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. |
| FullOperator | Full 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. |
| OptionGroup | A group of Options, usually within an OptionList. |
| BaseFullOption | This type is identical to FullOption but without the unknown index property. Extend from this type instead of FullOption directly. |
| BaseOptionMap | Map of option identifiers to their respective Option. |
| Combinator | Combinator definition used in the combinators prop of QueryBuilder. This type is an extension of FullCombinator where only name and label are required. |
| CombinatorByValue | Combinator definition used in the combinators prop of QueryBuilder. This type is an extension of FullCombinator where only value and label are required. |
| DefaultCombinator | A FullCombinator definition with a DefaultCombinatorName name property. |
| DefaultCombinatorExtended | A FullCombinator definition with a DefaultCombinatorNameExtended name property. |
| DefaultCombinatorName | Default allowed values for the combinator property. |
| DefaultCombinatorNameExtended | Default allowed values for the combinator property, plus "xor". |
| DefaultOperator | An FullOperator definition with a DefaultOperatorName name property. |
| DefaultOperatorName | Default values for the operator property. |
| Field | Field definition used in the fields prop of QueryBuilder. This type is an extension of FullField where only name and label are required. |
| FieldByValue | Field definition used in the fields prop of QueryBuilder. This type is an extension of FullField where only value and label are required. |
| FlexibleOption | A 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. |
| FlexibleOptionGroup | A group of BaseOptions, usually within a FlexibleOptionList. |
| FlexibleOptionList | An array of options or option groups, like OptionList but the option type may use either name or value as the primary identifier. |
| FlexibleOptionListProp | An array of options or option groups, like OptionList but the option type may use either name or value as the primary identifier. |
| FullCombinator | Full 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. |
| FullField | Full 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. |
| FullOption | A 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. |
| FullOptionList | An 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. |
| FullOptionMap | Map of option identifiers to their respective FullOption. |
| FullOptionRecord | Map of option identifiers to their respective FullOption. Must include all possible strings from the identifier type. |
| GetOptionIdentifierType | Extracts the type of the identifying property from a Option, ValueOption, or FullOption. |
| GetOptionType | Extracts the Option type from a FlexibleOptionList. |
| - | |
| Operator | Operator definition used in the operators/getOperators props of QueryBuilder. This type is an extension of FullOperator where only name and label are required. |
| OperatorByValue | Operator definition used in the operators/getOperators props of QueryBuilder. This type is an extension of FullOperator where only value and label are required. |
| Option | A generic option. Used directly in OptionList or as the child element of an OptionGroup. |
| OptionList | Either an array of Options or an array of OptionGroups. |
| ToFlexibleOption | Utility type to turn an Option, ValueOption, or BaseOption into a FlexibleOption. |
| ToFullOption | Utility type to turn an Option, ValueOption or BaseOption into a FullOption. |
| ValueOption | Like Option but requiring value instead of name. |
| filterFieldsByComparator | For 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. |
| getFirstOption | Gets the first option from an OptionList. |
| getOption | Gets the option from an OptionList with the given name. Handles Option arrays as well as OptionGroup arrays. |
| getRuleDefaultValue | Computes 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 ''. |
| isFlexibleOptionArray | Determines if an array is a flat array of FlexibleOption. |
| isFlexibleOptionGroupArray | Determines if a FlexibleOptionList is a FlexibleOptionGroup array. |
| isFullOptionArray | Determines if an array is a flat array of FullOption. |
| isFullOptionGroupArray | Determines if a FlexibleOptionList is a OptionGroup array of FullOption. |
| isOptionGroupArray | Determines if an OptionList is an OptionGroup array. |
| prepareOptionList | Normalizes 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. |
| resolveDefaultOperator | Resolves 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. |
| resolveOperatorList | Resolves 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. |
| resolveValueEditorType | Resolves 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". |
| resolveValueList | Resolves 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. |
| toFlatOptionArray | Flattens FlexibleOptionGroup arrays into BaseOption arrays. If the array is already flat, it is returned as is. |
| toFullOption | Converts an Option or ValueOption (i.e., BaseOption) into a FullOption. Full options are left unchanged. |
| toFullOptionList | Converts an OptionList or FlexibleOptionList into a FullOptionList. Lists of full options are left unchanged. |
| toFullOptionMap | Converts a FlexibleOptionList into a FullOptionList. Lists of full options are left unchanged. |
| toOptions | Generates an array of <option> or <optgroup> elements from a given OptionList. |
| uniqByIdentifier | Generates a new array of objects with duplicates removed based on the identifying property (value or name) |
| - | |
| uniqOptGroups | Generates a new OptionGroup array with duplicates removed based on the identifying property (value or name). |
| uniqOptList | Generates a new Option or OptionGroup array with duplicates removed based on the identifier property (value or name). |
Query Tools
| Name | Description |
|---|---|
| QueryManager | Stateful wrapper around the add/remove/update/move/ insert/group query tools, plus rule/group factories, * validation, and formatting. |
| QueryManagerError | Thrown by QueryManager methods in strict mode when an operation cannot be carried out because its target could not be used. |
| AbortInfo | Details about an aborted query tool operation. |
| AbortOptions | Options for reporting aborted query tool operations. |
| AddOptions | Options for add. |
| GroupOptions | Options for group. |
| GuardOptions | Options that block a mutation before it is attempted. |
| InsertOptions | Options for insert. |
| MoveOptions | Options for move. |
| QueryActionCallbacks | Confirmation callbacks invoked before a mutation is applied. Their return values are interpreted differently depending on the operation: |
| QueryActionHandlers | The 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. |
| QueryActionsConfig | Configuration for createQueryActions. |
| QueryManagerOptions | Options for QueryManager. Mirrors the subset of QueryBuilder props that affect query structure rather than rendering, so the same configuration objects can drive both. |
| QueryNode | A single rule or group encountered by QueryManager.walk, along with where it was found. |
| QueryToolOptions | Options shared by every query tool. |
| RemoveOptions | Options for remove. |
| StrictOptions | Per-call overrides for QueryManager's abort handling. Every mutating method accepts these alongside the options of the query tool it delegates to. |
| SubscriptionChange | What changed in the notification a QueryManager.subscribe listener is receiving. |
| UpdateOptions | Options for update. |
| WalkOptions | Options for QueryManager.walk and its derivatives. |
| AbortReason | Why 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. |
| DefaultFieldProp | The getDefaultField option: either a field name or a function that picks one. |
| DefaultOperatorProp | The getDefaultOperator option: either an operator name or a function that picks one. |
| add | Adds a rule or group to a query without mutating the original query. |
| addInPlace | Adds a rule or group to a query in place. |
| group | Creates 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. |
| groupInPlace | Creates 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. |
| insert | Inserts a rule or group into a query without mutating the original query. |
| insertInPlace | Inserts a rule or group into a query in place. |
| move | Moves 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. |
| moveInPlace | Moves a rule or group from one path to another in place. In the options parameter, pass { clone: true } to copy instead of move. |
| remove | Removes a rule or group from a query without mutating the original query. |
| removeInPlace | Removes a rule or group from a query in place. |
| setAutoFreeze | Globally 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. |
| strictAbortReasons | Abort 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. |
| update | Updates 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. |
| updateInPlace | Updates one or more properties of a rule or group within a query in place. See update for the supported argument forms and ordering semantics. |
| convertFromIC | Converts a RuleGroupTypeIC to RuleGroupType. |
| convertQuery | Converts a RuleGroupType to RuleGroupTypeIC. For a more explicit operation, use convertToIC. |
| convertToIC | Converts a RuleGroupType to RuleGroupTypeIC. |
| createQueryActions | Builds the query builder's six mutation handlers as pure functions of the current query. |
| createRule | Creates 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. |
| createRuleGroup | Creates a group from the given configuration. Pass true for independentCombinators to omit the combinator property. |
| deriveQueryBuilderClassNames | The outer (wrapper) classname for the query builder itself, including the conditional disabled, valid, and invalid state classes. |
| deriveRuleClassName | The 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. |
| deriveRuleClassNames | Classnames for each element rendered by a rule. This is the framework-agnostic core of the classNames object returned by the useRule hook. |
| deriveRuleContext | Resolves 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. |
| deriveRuleGroupClassNames | Classnames 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. |
| deriveRuleGroupContext | Resolves everything about a rule group that depends on the combinator configuration, plus its validation result. |
| deriveRuleGroupOuterClassName | The outer (wrapper) classname for a rule group, including every conditional state class. |
| deriveRuleOuterClassName | The outer (wrapper) classname for a rule, including every conditional state class. |
| exceedsMaxLevels | Whether adding a group beneath parentPath would exceed maxLevels. |
| getGuardAbortReason | Whether a mutation targeting pathOrID is blocked by the given guards, and why. Returns null when the mutation may proceed. |
| resolveCandidateQuery | Resolves 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
| Function | Description |
|---|---|
| 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 | - |
| findID | Returns the RuleType or RuleGroupType/RuleGroupTypeIC with the given id within a query. |
| findPath | Returns the RuleType or RuleGroupType/RuleGroupTypeIC at the given path within a query. |
| generateID | Default 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 |
| getCommonAncestorPath | Finds the deepest/longest path that two paths have in common. |
| getCompatContextProvider | Generates a context provider for a compatibility package. |
| getDispatchQueryById | Returns the dispatchQuery function for the query builder with the given qbId, or undefined if no such query builder is mounted. |
| getFieldData | Resolves 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. |
| getMatchModesUtil | Utility 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. |
| getParametersAsList | Normalizes the result of getParameters to a non-empty list or null. |
| getParentPath | Truncates the last element of an array and returns the result as a new array. |
| getParseNumberMethod | - |
| getPathOfID | Returns the Path of the RuleType or RuleGroupType/RuleGroupTypeIC with the given id within a query. |
| getQuerySelectorById | Given a qbId (passed to every component as part of the schema prop), returns a Redux selector for use with useQueryBuilderSelector. |
| getRqbStore | Gets the singleton React Query Builder store instance. DevTools are enabled if either: - globalThis.RQB_DEVTOOLS is truthy - window.RQB_DEVTOOLS is truthy |
| getRuleGroupCombinator | The 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). |
| getRuleInputType | The input type for a rule. A field's own inputType takes precedence over getInputType. |
| getRuleValidationResult | The validation result for a rule: the entry from a query-level ValidationMap if present, otherwise the field's own validator result, otherwise null. |
| getRuleValueEditorType | The value editor type for a rule. valueSource: "field" always uses a select list, and valueSource: "parameter" uses a (multi)select when parameters are available. |
| getRuleValues | The option list presented by a rule's value editor, resolved from its valueSource. |
| getRuleValueSourceOptions | Value 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. |
| getValidationClassNames | Gets the standard classname for valid or invalid components based on the given validation result. |
| getValueSourcesUtil | Utility 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. |
| hideValueControlsForOperator | Whether the value editor(s) should be hidden for an operator, based on its arity. |
| injectSlice | Injects a slice into the React Query Builder store. Useful for extensions that need to integrate their own state management. |
| isAncestor | Determines 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. |
| isPojo | Determines if a variable is a plain old JavaScript object, aka POJO. |
| isRuleGroup | Determines if an object is a RuleGroupType or RuleGroupTypeIC. |
| isRuleGroupType | Determines if an object is a RuleGroupType. |
| isRuleGroupTypeIC | Determines if an object is a RuleGroupTypeIC. |
| isRuleOrGroupValid | Determines 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. |
| isRuleType | Determines if an object is a RuleType (only checks for a field property). |
| isUnsafeKey | Returns true if the key could cause prototype pollution when used as a property name in bracket-notation assignment. |
| isValidationResult | Determines if an object is useful as a validation result. |
| joinWith | Joins 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. |
| lc | Converts a value to lowercase if it's a string, otherwise returns the value as is. |
| mergeAnyTranslation | - |
| mergeAnyTranslations | Merges any number of partial translations into a single definition. |
| mergeClassnames | Merges a list of partial Classnames definitions into a single definition. |
| mergeTranslation | - |
| mergeTranslations | Merges any number of partial Translations into a single definition. |
| nullFreeArray | Determines if an array is free of null/undefined. |
| nullOrUndefinedOrEmpty | Simple helper to determine whether a value is null, undefined, or an empty string. |
| optionsEqual | Whether two QueryManagerOptions objects describe the same configuration, per valuesEqual: data by value, functions by identity. |
| parseNumber | Converts 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. |
| pathIsDisabled | Determines if the rule or group at the specified path is either disabled itself or disabled by an ancestor group. |
| pathsAreEqual | Determines if two paths (each Path) are equivalent. |
| preferAnyProp | For given default, prop, and context values, return the first provided of prop, context, and default, in that order. |
| preferFlagProps | For 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. |
| preferProp | For given default, prop, and context values, return the first provided of prop, context, and default, in that order. |
| prepareRule | Ensures that a rule is valid by adding an id property if it does not already exist. |
| prepareRuleGroup | Ensures 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. |
| prepareRuleOrGroup | Ensures that a rule or group is valid. See prepareRule and prepareRuleGroup. |
| processMatchMode | Transforms - match: { mode: "atLeast", threshold: 1 } to match: { mode: "some" } - match: { mode: "atMost", threshold: 0 } to match: { mode: "none" }. |
| regenerateID | Generates a new id property for a rule. |
| regenerateIDs | Recursively generates new id properties for a rule group and all its rules and subgroups. |
| shouldCoalesce | Determines 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. |
| signatureOf | Describes 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. |
| splitBy | Splits 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. |
| toArray | Splits a string by comma then trims each element. Arrays are returned as is except any string elements are trimmed. |
| transformQuery | Recursively process a query heirarchy using this versatile utility function. |
| trimIfString | Trims the value if it is a string. Otherwise returns the value as is. |
| useFields | - |
| useMatchModeEditor | - |
| usePathsMemo | - |
| valuesEqual | Structural equality for QueryManagerOptions values. Arrays and plain objects are compared by value; everything else — functions, class instances, Maps, Dates — by identity. |
Interfaces
| Interface | Description |
|---|---|
| AddMethod | - |
| ClassnameCondition | A classname applied only when when returns true for the current state. |
| ClassnameSpec | How one derived classname is composed: the controlClassnames keys that contribute to it (in application order, after the standard classname), plus any state-dependent classes. |
| CommonRuleAndGroupProperties | Properties common to both rules and groups. |
| CreateRuleGroupOptions | Everything createRuleGroup needs to produce a new group. |
| CreateRuleOptions | Everything createRule needs to produce a new rule. Each member corresponds to the QueryBuilder prop (or useQueryBuilderSetup output) of the same name. |
| DefaultRuleGroupTypeIC | RuleGroupTypeIC with combinators limited to DefaultCombinatorName and rules limited to DefaultRuleType. |
| DeriveClassNamesOptions | Options common to every classname derivation. |
| DndClassNameState | Drag-and-drop state that can contribute conditional classnames. |
| DragCollection | - |
| DropCollection | - |
| DropResult | - |
| GetRuleDefaultValueOptions | Options for getRuleDefaultValue. |
| GroupMethod | - |
| InsertMethod | - |
| LazyLoadedSlices | - |
| MatchConfig | Quantification mode describing how many elements of the value array must pass the filter for the rule itself to pass. |
| MoveMethod | - |
| OuterClassNameOptions | Inputs to deriveRuleOuterClassName and deriveRuleGroupOuterClassName. |
| OuterClassNameOptionsBase | Inputs common to every outer (wrapper) classname derivation. |
| ParseNumberOptions | Options object for parseNumber. |
| PathInfo | The path of a child rule or group, and whether it is disabled. |
| PreparedOptionList | Result of prepareOptionList. |
| PrepareOptionListParams | Parameters for prepareOptionList. |
| PreparerOptions | Options for prepareRule/prepareRuleGroup. |
| QueryBuilderClassNameState | State that contributes conditional classnames to the query builder's wrapper element. |
| QueryBuilderFlags | - |
| QueryHistoryOptions | Options controlling how query changes are recorded for undo/redo. |
| RegenerateIdOptions | Options object for regenerateID/regenerateIDs. |
| RemoveMethod | - |
| ResolveOptionListOptions | Options shared by the resolvers below that produce a normalized option list. |
| RqbState | - |
| RuleClassNameState | State that contributes conditional classnames to a rule's wrapper element. |
| RuleContext | Everything deriveRuleContext resolves for a single rule. |
| RuleContextResolvers | Functions used by deriveRuleContext to resolve a rule's configuration. Each corresponds to the QueryBuilder prop (or useQueryBuilderSetup output) of the same name. |
| RuleGroupContext | Everything deriveRuleGroupContext resolves for a single rule group. |
| RuleGroupType | The main rule group type. This type is used for query definitions as well as all sub-groups of queries. |
| RuleGroupTypeIC | The main rule group interface when using independent combinators. This type is used for query definitions as well as all sub-groups of queries. |
| RuleType | The main rule type. The field, operator, and value properties can be narrowed with generics. |
| TransformQueryOptions | Options object for index!transformQuery transformQuery. |
| UpdateMethod | Updates a single property of a rule or group. |
| UseControlledOrUncontrolledParams | - |
| UseFields | - |
| UseMatchModeEditor | - |
| UseOptionListProp | Result of prepareOptionList. |
| UseOptionListPropParams | Parameters for prepareOptionList. |
| UseQbId | - |
| UseRuleDnD | Return type of @react-querybuilder/dnd!useRuleDnD hook. |
| UseRuleGroupDnD | Return type of @react-querybuilder/dnd!useRuleGroupDnD hook. |
| UseSelectElementChangeHandlerParams | - |
| UseValueEditor | - |
| ValidationResult | Object with a valid boolean value and optional reasons. |
Type Aliases
| Type Alias | Description |
|---|---|
| AccessibleDescriptionGenerator | Signature of accessibleDescriptionGenerator prop, used by QueryBuilder to generate accessible descriptions for each RuleGroup. |
| ActionElementEventHandler | - |
| Arity | Allowed values of the FullOperator property arity. A value of "unary" or a number less than two will cause the default ValueEditor to render null. |
| Classname | String 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 | - |
| DefaultRuleGroupArray | The type of the rules array in a DefaultRuleGroupType. |
| DefaultRuleGroupICArray | The type of the rules array in a DefaultRuleGroupTypeIC. |
| DefaultRuleGroupType | RuleGroupType with the combinator property limited to DefaultCombinatorNameExtended and rules limited to DefaultRuleType. |
| DefaultRuleGroupTypeAny | Shorthand for "either DefaultRuleGroupType or DefaultRuleGroupTypeIC". |
| DefaultRuleOrGroupArray | Shorthand for "either DefaultRuleGroupArray or DefaultRuleGroupICArray". |
| DefaultRuleType | RuleType with the operator property limited to DefaultOperatorName. |
| DispatchQueryFn | - |
| DndDropTargetType | - |
| DraggedItem | - |
| DropEffect | - |
| ExpressionNode | A single node in an expression tree. Expressions are recursive: a func node's arguments are themselves ExpressionNodes, enabling arbitrary nesting. |
| FindPathReturnType | Return type for findPath. |
| GenericizeRuleGroupType | Converts a narrowed rule group type to its most generic form. |
| GetCompatContextProviderProps | - |
| GetRuleGroupType | Determines if a type extending RuleGroupTypeAny is actually RuleGroupType or RuleGroupTypeIC. |
| GetRuleTypeFromGroupWithFieldAndOperator | Determines 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. |
| InputType | HTML5 input types |
| JsonLogicAll | - |
| JsonLogicAnd | - |
| JsonLogicDoubleNegation | - |
| JsonLogicEqual | - |
| JsonLogicGreaterThan | - |
| JsonLogicGreaterThanOrEqual | - |
| JsonLogicInArray | - |
| JsonLogicInString | - |
| JsonLogicLessThan | - |
| JsonLogicLessThanOrEqual | - |
| JsonLogicNegation | - |
| JsonLogicNone | - |
| JsonLogicNotEqual | - |
| JsonLogicOr | - |
| JsonLogicReservedOperations | - |
| JsonLogicRulesLogic | - |
| JsonLogicSome | - |
| JsonLogicStrictEqual | - |
| JsonLogicStrictNotEqual | - |
| JsonLogicVar | - |
| MatchMode | - |
| MatchModeOptions | - |
| ParseNumberMethod | Parsing algorithms used by parseNumber. |
| ParseNumbersPropConfig | Options for the parseNumbers prop of QueryBuilder. |
| Path | - |
| QueryValidator | Function that validates a query. |
| RemoveNullability | Utility type to make all properties non-nullable. |
| RqbStore | - |
| RuleClassnameKey | Keys of the classNames object returned for a rule. |
| RuleFacet | The 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. |
| RuleGroupArray | The type of the rules array in a RuleGroupType. |
| RuleGroupClassnameKey | Keys of the classNames object returned for a rule group. |
| RuleGroupICArray | The type of the rules array in a RuleGroupTypeIC. |
| RuleGroupTypeAny | Shorthand for "either RuleGroupType or RuleGroupTypeIC". |
| RuleOrGroupArray | Shorthand for "either RuleGroupArray or RuleGroupICArray". |
| RuleValidator | Function that validates a rule. |
| StringUnionToFlexibleOptionArray | - |
| StringUnionToFullOptionArray | - |
| ToRuleGroupType | Converts 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. |
| ToRuleGroupTypeIC | Converts a RuleGroupType extension to the corresponding RuleGroupTypeIC type, preserving any additional properties. If the type already extends RuleGroupTypeIC, it is returned as-is. |
| UpdateableProperties | All updateable properties of rules and groups (everything except id, path, and rules). |
| UpdateValueMap | A map of UpdateableProperties to their new values, for updating multiple properties of a rule or group in a single operation. |
| UseMergedContextParams | - |
| UseQueryBuilderSchema | - |
| UseQueryBuilderSetup | - |
| UseValueSelectorParams | - |
| ValidationMap | Map of rule/group id to its respective ValidationResult. |
| ValueChangeEventHandler | - |
| ValueEditorType | Type of ValueEditor that will be displayed. |
| ValueSource | A source for the value property of a rule. |
| ValueSourceFlexibleOptions | - |
| ValueSourceFullOptions | - |
| ValueSources | A valid array of potential value sources. |
| WithRequired | Utility type to make one or more properties required. |
| WithUnknownIndex | Adds an unknown index property to an interface. |
Variables
| Variable | Description |
|---|---|
| defaultCombinatorLabelMap | - |
| defaultOperatorLabelMap | - |
| defaultValidator | This 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 | - |
| numericRegex | Regex matching numeric strings. Passes for positive/negative integers, decimals, and E notation, with optional surrounding whitespace. |
| objectEntries | A strongly-typed version of Object.entries(). |
| objectKeys | A strongly-typed version of Object.keys(). |
| QueryBuilderContext | Context provider for QueryBuilder. Any descendant query builders will inherit the props from a context provider. |
| QueryBuilderStateContext | - |
| queryBuilderStore | - |
| structuralSignature | Signature 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. |
| subqueryElementAliasBase | Base alias assigned to the element binding of a subquery generated for a rule's `match` mode (e.g. unnest(field) as elem_alias). |
| unchangedSignature | Signature returned when two queries differ by reference only, with no observable difference in their properties. |
| uuidV4regex | - |
Accessibility
| Variable | Description |
|---|---|
| generateAccessibleDescription | The 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
| Function | Description |
|---|---|
| derivePathInfo | Builds 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. |
| pathIsDisabledByPaths | Determines 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
| Function | Description |
|---|---|
| coerceBigIntValue | Coerces 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). |
| coerceInputType | The 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. |
| getMultiValueUpdate | Produces the next value for a series of value editors when the editor at index changes. |
| getValueEditorReset | Determines 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. |
| getValueSelectorUpdate | Produces 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. |
| isBetweenOperator | Whether an operator's value is a list of two bounds. |
| normalizeValueSelectorValue | Normalizes 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.