nix-ui-tree-select
v1.0.2
Published
Cascading tagfield - React Component
Downloads
2
Readme
@nix-ui/tree-select
Cascading tagfield - React Component
Install
npm install --save nix-ui-tree-select
Usage
import React, { Component } from 'react'
import TreeSelect from 'nix-ui-tree-select'
class App extends Component {
state = {
users: []
}
onTreeSelectChange = (users: any) => {
this.setState({ users })
}
render() {
return (
<div className="App" style={{ padding: '20px' }}>
<div style={{ width: '250px' }}>
<TreeSelect
data={data}
label="Users"
nameField="name"
onChange={this.onTreeSelectChange}
search
valueField="value"
value={this.state.users}
/>
</div>
</div>
)
}
}
export default App
const data = [{
name: 'pm1',
value: 1
}, {
name: 'org',
value: [{
name: 'org1',
value: 11
}, {
name: 'org2,
value: 12
}]
}]
License
MIT © NicolasBG87