| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 11 个月前 | ||
| 1 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 19 天前 | ||
| 1 个月前 | ||
| 5 个月前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 3 天前 | ||
| 3 天前 |
@react-querybuilder/mantine
Official react-querybuilder compatibility package for Mantine.
- Demo
- Full documentation
- CodeSandbox / StackBlitz example projects

Installation
npm i react-querybuilder @react-querybuilder/mantine @mantine/core @mantine/dates @mantine/hooks
# OR yarn add / pnpm add / bun add
Usage
To configure the query builder to use Mantine-compatible components, place QueryBuilderMantine above QueryBuilder in the component hierarchy.
import { QueryBuilderMantine } from '@react-querybuilder/mantine';
import { useState } from 'react';
import { type Field, QueryBuilder, type RuleGroupType } from 'react-querybuilder';
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 (
<QueryBuilderMantine>
<QueryBuilder fields={fields} defaultQuery={query} onQueryChange={setQuery} />
</QueryBuilderMantine>
);
}
QueryBuilderMantine 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 |
|---|---|
mantineControlElements |
controlElements |
MantineActionElement |
controlElements.actionElement |
MantineNotToggle |
controlElements.notToggle |
MantineShiftActions |
controlElements.shiftActions |
MantineValueEditor |
controlElements.valueEditor |
MantineValueSelector |
controlElements.valueSelector |