🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@react-querybuilder/fluent

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-querybuilder/fluent

Custom Fluent UI components for react-querybuilder

6.0.4
Source
npm
Version published
Weekly downloads
173
-39.93%
Maintainers
1
Weekly downloads
 
Created
Source

@react-querybuilder/fluent

Official react-querybuilder components for Fluent UI.

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

Full documentation

Installation

npm i --save react-querybuilder @react-querybuilder/fluent @fluentui/react-components
# OR
yarn add react-querybuilder @react-querybuilder/fluent @fluentui/react-components

Usage

To render Fluent UI-compatible components in the query builder, wrap the <QueryBuilder /> element in <QueryBuilderFluent />.

import { FluentProvider, webLightTheme } from '@fluentui/react-components';
import { QueryBuilderFluent } from '@react-querybuilder/fluent';
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 (
    <FluentProvider theme={webLightTheme}>
      <QueryBuilderFluent>
        <QueryBuilder fields={fields} query={query} onQueryChange={q => setQuery(q)} />
      </QueryBuilderFluent>
    </FluentProvider>
  );
};

Notes

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

FAQs

Package last updated on 05 Mar 2023

Did you know?

Socket

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.

Install

Related posts