react-choose-group
Build radio/checkbox group in a short time.
example(/example/example.js)
// import the Component...Component // render the Component { return <div> <Group type='radio' name='nameYourGroup' items=123 value=thisstatevalue onChange=thishandleChange /> </div> }
props
props | description | required |
---|---|---|
wrapperClassName | classname of the wrapper | |
wrapperStyle | style of the wrapper | |
itemClassName | classname of every item | |
itemStyle | style of every item | |
name | name of the group | Y |
value | as a controlled component, the value is the whole group's value | Y |
type | type of items, is radio or checkbox |
Y |
items | items array | Y |
onChange | function to handle the changing of the value | Y |
otherValues | contains show (boolean) and separator , if show is true, an input(text) will be rendered to get other values, if type prop is checkbox , the input will be separated by the separator |