github.com/stampzilla/stampzilla-go@v2.0.0-rc9+incompatible/nodes/stampzilla-server/web/src/components/CustomCheckbox.js (about) 1 import React from 'react'; 2 3 const CustomCheckbox = (props) => { 4 const { 5 id, 6 value, 7 required, 8 disabled, 9 readonly, 10 label, 11 autofocus, 12 onChange, 13 } = props; 14 return ( 15 <div className={`checkbox custom-control custom-checkbox ${disabled || readonly ? 'disabled' : ''}`}> 16 <input 17 type="checkbox" 18 className="custom-control-input" 19 id={id} 20 checked={typeof value === 'undefined' ? false : value} 21 required={required} 22 disabled={disabled || readonly} 23 autoFocus={autofocus} 24 onChange={event => onChange(event.target.checked)} 25 /> 26 <label className="custom-control-label" htmlFor={id}> 27 <span>{label}</span> 28 </label> 29 </div> 30 ); 31 }; 32 33 export default CustomCheckbox;