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

7.2.0 • Public • Published

@react-querybuilder/mantine

Official react-querybuilder components for Mantine.

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

Full documentation

Installation

npm i react-querybuilder @react-querybuilder/mantine @mantine/core @mantine/hooks
# OR yarn add / pnpm add / bun add

Usage

To render Mantine-compatible components in the query builder, wrap the <QueryBuilder /> element in <QueryBuilderMantine />.

import { QueryBuilderMantine } from '@react-querybuilder/mantine';
import { QueryBuilder, RuleGroupType } from 'react-querybuilder';

const fields = [
  { name: 'firstName', label: 'First Name' },
  { name: 'lastName', label: 'Last Name' },
];

const App = () => {
  const [query, setQuery] = useState<RuleGroupType>({ combinator: 'and', rules: [] });

  return (
    <QueryBuilderMantine>
      <QueryBuilder fields={fields} query={query} onQueryChange={setQuery} />
    </QueryBuilderMantine>
  );
};

Notes

  • This package exports mantineControlElements which can be assigned directly to the controlElements prop on <QueryBuilder /> (and also exports each component individually), but wrapping <QueryBuilder /> in <QueryBuilderMantine /> is the recommended method.

Readme

Keywords

none

Package Sidebar

Install

npm i @react-querybuilder/mantine

Weekly Downloads

525

Version

7.2.0

License

MIT

Unpacked Size

198 kB

Total Files

20

Last publish

Collaborators

  • jakeboone02