1.0.3 • Published 5 years ago
cig-x v1.0.3
cig-x
The Select and Tab control for React.
Installation and usage
The easiest way to use cig-x is to install it from npm and build it into your app with Webpack.
npm i -S cig-x
Then use it in your App:
import React from 'react'
import { SelectMulti } from 'cig-x'
export default () => {
const options = [
{
value: 'fruit',
label: 'fruit',
option: [
{
value: 'apple',
},
{
value: 'orange',
},
{
value: 'banana',
},
],
},
{
value: 'vegetables',
label: 'vegetables',
option: [
{
value: 'potato',
},
{
value: 'cucumber',
},
],
},
]
const onChange = () {
console.log(v)
}
return (
<SelectMulti
options={options}
onChange={onChange}
/>
)
}
Props
Common props you may want to specify include:
- inputValue/onInputChange- control the value of the search input (changing this will update the available options)
- placeholder- change the text displayed when no option is selected
- mutil - allow the user to select multiple values
License
MIT Licensed. Copyright (c) CIG 2020.