Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@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.0.0] - 2024-11-08
@react-querybuilder/chakra
now supports Chakra UI version 3 and no longer supports version 2. For Chakra UI version 2 support, use @react-querybuilder/chakra2
.ChakraDragHandle
has been removed. In Chakra UI version 3 environments, the default DragHandle
component works without augmentation."react-querybuilder"
imports to "react-querybuilder/debug"
.bootstrapClassnames
no longer includes value: "form-control form-control-sm"
. The classes are added by BootstrapValueEditor
only when necessary.@react-querybuilder/bulma
properly indicates compatibility with Bulma v1 in its peerDependencies
, and the website demo now uses Bulma v1.FAQs
Custom MUI (Material Design) components for react-querybuilder
The npm package @react-querybuilder/material receives a total of 6,941 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 0 open source maintainers 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.