{this.props.label && (
{label}
)}
{helpButton && (
{helpButton}
)}
>
);
}
}
Checkbox.propTypes = {
/** Used as HTML id property */
id: PropTypes.string,
/** Used as HTML `name` property */
name: PropTypes.string,
/** Value of the input */
value: PropTypes.string,
/** Label of the input */
label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
/** The checked property sets the checked state of a checkbox */
isChecked: PropTypes.bool,
/** If true, this state is shown as a rectangle in the checkbox */
isIndeterminate: PropTypes.bool,
/** Disables the Checkbox input */
isDisabled: PropTypes.bool,
/** Will be triggered whenever an CheckboxInput is clicked */
onChange: PropTypes.func,
/** Accepts class */
className: PropTypes.string,
/** Accepts css style */
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
/** Title */
title: PropTypes.string,
/** Disables word wrapping */
truncate: PropTypes.bool,
/** Help button render */
helpButton: PropTypes.any,
isLogin: PropTypes.bool,
};
Checkbox.defaultProps = {
isChecked: false,
truncate: false,
isLogin: false,
};
export default React.memo(Checkbox);