dispatch/client/js/components/ui/Checkbox.js
2020-05-12 07:48:12 +02:00

19 lines
430 B
JavaScript

import React from 'react';
import classnames from 'classnames';
const Checkbox = ({ name, label, topLabel, classNameLabel, ...props }) => (
<label
className={classnames('checkbox', classNameLabel, {
'top-label': topLabel
})}
htmlFor={name}
>
{topLabel && label}
<input type="checkbox" id={name} name={name} {...props} />
<span />
{!topLabel && label}
</label>
);
export default Checkbox;