checkboxes-component v1.1.0
Overview
react-checkboxes - component that renders several checkboxes (or radio) as single input.
Installation
To install the stable version:
npm install --save react-checkboxesUsage
import {Checkboxes} from 'react-merge'Documentation
####Checkboxes(props: CheckboxesProps)
CheckboxesProps - object with following properties:
_$useTag: string | FunctionComponent- tag than will be used for chexboxes, default isCheckbox.$enum: Array<string | number>- array of possible values.$staticProps: anyObject- props that passed to every inner checkbox.onChangeoronClickshould be passed here.$enumExten: anyObject- extension of$enum, props that passed to inner checkbox individually.name: string- name for inner checkboxes.type: string- type of checkboxes (radioorchexboxfor input)value: any- value[key: string]: any- rest props will be passed to the root element unchanged.
####Checkbox(props: CheckboxProps)
CheckboxesProps - object with following properties:
name: string- nametype: string- type of checkbox (radioorchexboxfor input)label: string- labelvalue: any- value$extend- ComponentCheckboxconsists of 3 inner elements:checkbox,input,label. Elementsinputandlabelare inner elements ofcheckboxelement. Each element can be extended with custom props passed in$extend[elementName]. For example, to add tolabelproponClickshould be like:$extend = {label: {onClick:()=>alert('label')}}[key: string]: any- rest props will be passed to the input element unchanged.