react-rule-group
v1.0.2
Published
React library to implement Rule/Group Hierarchy
Downloads
3
Readme
react-rule-group
Made with create-react-library
Install
npm install --save react-rule-group
Usage
import React, { Component } from 'react'
import { ReactRuleGroup } from 'react-rule-group'
import 'react-rule-group/dist/index.css'
const inputJson = [
{
"id": "g1",
"type": "group",
"rules": [
{
"type": "rule",
"condition": {
"condition_type":"last_name",
"condition_operator":"=",
"condition_value":"Praveen",
}
},
{
"id": "g1_g2",
"type": "group",
"rules": [
{
"type": "rule",
"condition": {
"condition_type":"",
"condition_operator":"",
"condition_value":"",
}
},
],
"operator": "AND"
}
],
"operator": "OR"
}
],
"operator": "AND"
}
]
class Example extends Component {
render() {
return <ReactRuleGroup rules={inputJson} />
}
}
License
MIT © praveenax