Ninja Pokémon Master

    @react-querybuilder/material
    TypeScript icon, indicating that this package has built-in type declarations

    4.5.1 • Public • Published

    @react-querybuilder/material

    Official react-querybuilder components for MUI/Material Design.

    To see them in action, check out the react-querybuilder demo or load the example in CodeSandbox.

    Installation

    npm i --save react-querybuilder @react-querybuilder/material @mui/icons-material @mui/material
    # OR
    yarn add react-querybuilder @react-querybuilder/material @mui/icons-material @mui/material

    Usage

    import { createTheme, ThemeProvider } from '@mui/material/styles';
    import { materialControlElements } from '@react-querybuilder/material';
    import { QueryBuilder, RuleGroupType } from 'react-querybuilder';
    
    const muiTheme = createTheme();
    
    const fields = [
      { name: 'firstName', label: 'First Name' },
      { name: 'lastName', label: 'Last Name' },
    ];
    
    const App = () => {
      const [query, setQuery] = useState<RuleGroupType>({ combinator: 'and', rules: [] });
    
      return (
        <ThemeProvider theme={muiTheme}>
          <QueryBuilder
            fields={fields}
            query={query}
            onQueryChange={q => setQuery(q)}
            controlElements={materialControlElements}
          />
        </ThemeProvider>
      );
    };

    Keywords

    none

    Install

    npm i @react-querybuilder/material

    DownloadsWeekly Downloads

    347

    Version

    4.5.1

    License

    MIT

    Unpacked Size

    3.09 MB

    Total Files

    15

    Last publish

    Collaborators

    • jakeboone02