Git Product home page Git Product logo

react-filter-control's Introduction

GitHub license Build Status Coverage Status

React Filter Control

The React component for building the composite filter criteria

Demo

Overview

Filter Control

Installation

npm

npm install react-filter-control

yarn

yarn add react-filter-control

Usage

A basic example

import React from "react";
import ReactDOM from "react-dom";
import FilterControl from "react-filter-control";
import { fields, filterValue } from "./data.js";

const handleFilterValueChange = filterValue => {
  // ...
};

const App = () => {
  return (
    <FilterControl
      filterValue={filterValue}
      fields={fields}
      onFilterValueChanged={handleFilterValueChange}
    />
  );
};

ReactDOM.render(<App />, document.querySelector("#root"));

Open Example in CodeSandbox

API

FilterControl

Properties

Name Type Description
fields Array.<Field> The fields settings
filterValue FilterValue The filterValue settings
groups Array.<Group> The groups settings
onFilterValueChanged event The filter value changed handler

FilterValue : Object

Properties

Name Type Description
groupName string Group name
items Array.<(FilterValueGroup|FilterValueItem)> Items in group

FilterValueGroup : Object

Properties

Name Type Description
key key Item key
groupName string Group name
items Array.<(FilterValueGroup|FilterValueItem)> Items in group

FilterValueItem : Object

Properties

Name Type Description
key key Item key
field string Field
operator string Operator
value string Value

Field : Object

Properties

Name Type Description
name string Field name
caption string Field caption
operators Array.<Operator> Field operators

Group : Object

Properties

Name Type Description
name string Group name
caption string Group caption

Operator : Object

Properties

Name Type Description
name string Operator name
caption string Operator caption

License

This project is licensed under the terms of the MIT license.

react-filter-control's People

Contributors

komarovalexander avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.