design-comuni-plone-theme
Version:
Volto Theme for Italia design guidelines
23 lines (20 loc) • 477 B
JSX
/**
* Checkbox that supports the indeterminate property as a react prop
*/
import React from 'react';
import cx from 'classnames';
export default function Checkbox({ indeterminate = false, ...otherProps }) {
const setCheckboxRef = (checkbox) => {
if (checkbox) {
checkbox.indeterminate = indeterminate;
}
};
return (
<input
className={cx({ indeterminate })}
type="checkbox"
ref={setCheckboxRef}
{...otherProps}
/>
);
}