on bf5080e help sign in
bridge/src/components/Checkbox.js
47 lines 1.0 kB history raw
1import React from 'react'
3const CheckBox = ({
4 name,
5 id,
6 title,
7 subtitle,
8 onChange,
9 className,
10 state,
11 children,
12 childContainerClassname,
13 disabled
14}) => {
16 const isCheckedClassname = state === true
17 ? 'cb-on'
18 : 'cb-off';
21 return (
22 <div className={`cb flex items-center ${isCheckedClassname} ${className}`}>
23 <label className={'s-6 m-0 mr-4 rel outline-blue'}>
25 <input
26 disabled={ disabled }
27 name={name}
28 id={id}
29 type={'checkbox'}
30 className={'none'}
31 checked={state}
32 onChange={onChange} />
34 <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
35 <path d='M2 3.55661V0H0V5.55661H12.4182V3.55661H2Z' transform='translate(4 11) rotate(-45)' fill='white'/>
36 </svg>
38 </label>
39 <div className={`user-select-none ${childContainerClassname} mt-1`}>
40 { children }
41 </div>
42 </div>
43 )
47export default CheckBox