
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
@react-querybuilder/material
Advanced tools
Custom MUI (Material Design) components for react-querybuilder
Official react-querybuilder compatibility package for MUI/Material Design.
npm i react-querybuilder @react-querybuilder/material @mui/icons-material @mui/material
# OR yarn add / pnpm add / bun add
To configure the query builder to use Material-compatible components, place QueryBuilderMaterial
above QueryBuilder
and beneath MaterialProvider
in the component hierarchy.
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { QueryBuilderMaterial } from '@react-querybuilder/material';
import { useState } from 'react';
import { type Field, QueryBuilder, type RuleGroupType } from 'react-querybuilder';
const muiTheme = createTheme();
const fields: Field[] = [
{ name: 'firstName', label: 'First Name' },
{ name: 'lastName', label: 'Last Name' },
];
export function App() {
const [query, setQuery] = useState<RuleGroupType>({ combinator: 'and', rules: [] });
return (
<ThemeProvider theme={muiTheme}>
<QueryBuilderMaterial>
<QueryBuilder fields={fields} defaultQuery={query} onQueryChange={setQuery} />
</QueryBuilderMaterial>
</ThemeProvider>
);
}
QueryBuilderMaterial
is a React context provider that assigns the following props to all descendant QueryBuilder
elements. The props can be overridden on the QueryBuilder
or used directly without the context provider.
Export | QueryBuilder prop |
---|---|
materialControlElements | controlElements |
materialTranslations | translations |
MaterialActionElement | controlElements.actionElement |
MaterialDragHandle | controlElements.dragHandle |
MaterialNotToggle | controlElements.notToggle |
MaterialShiftActions | controlElements.shiftActions |
MaterialValueEditor | controlElements.valueEditor |
MaterialValueSelector | controlElements.valueSelector |
[!TIP]
By default, this package uses icons from
@mui/icons-material
for button labels. To reset button labels to their default strings, usedefaultTranslations
fromreact-querybuilder
.
<QueryBuilderMaterial translations={defaultTranslations}>
[!IMPORTANT]
In environments based on React Server Components, preload the MUI components.
[v8.7.1] - 2025-06-09
rqb-base-color
. rqb-background-color
is rqb-base-color
with 20% opacity (effectively the same color as before, just calculated differently).maxLevels
prop to limit the addition of new rule groups beyond the specified nesting level. Default is Infinity
(allows unlimited levels), and values other than 1 or greater will be ignored.FAQs
Custom MUI (Material Design) components for react-querybuilder
The npm package @react-querybuilder/material receives a total of 12,168 weekly downloads. As such, @react-querybuilder/material popularity was classified as popular.
We found that @react-querybuilder/material demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.