19 lines
398 B
JavaScript
Raw Normal View History

2018-05-16 05:02:48 +02:00
import React from 'react';
2018-10-15 08:56:17 +02:00
import classnames from 'classnames';
2018-05-16 05:02:48 +02:00
2018-10-15 08:56:17 +02:00
const Checkbox = ({ name, label, topLabel, ...props }) => (
<label
className={classnames('checkbox', {
'top-label': topLabel
})}
htmlFor={name}
>
{topLabel && label}
<input type="checkbox" id={name} name={name} {...props} />
<span />
{!topLabel && label}
</label>
2018-05-16 05:02:48 +02:00
);
export default Checkbox;