UNPKG

hiromi

Version:

React components for Bulma. http://bulma.io/

28 lines (22 loc) 588 B
import React, {PropTypes} from 'react'; import classnames from 'classnames'; import Label from '../Label'; import {defaultReactProps, defaultReactPropsValues} from '../utils'; const Checkbox = ({input, children, ...props}) => { const inputElement = input ? input : <input type="checkbox" />; return ( <Label isCheckbox {...props}> {inputElement} {children} </Label> ); }; Checkbox.propTypes = { input: PropTypes.node, children: PropTypes.node, ...defaultReactProps }; Checkbox.defaultProps = { ...defaultReactPropsValues }; export default Checkbox;