item={{id:"abc123",value:"abc123",label:"Sign up for our email newsletter"}}
isSelected={checked}
onChange={()=>setChecked(!checked)}
size={size}
/>
))}
</div>
)
}
Theming
We also supports a dark theme for all variants:
Editable example
()=>{
const[checked, setChecked]= React.useState(false)
return(
<Cardtheme={CardTheme.Dark}>
<divclassName="space-inset-m">
<h3>Packing list</h3>
<Checkbox
size={CheckboxSize.Medium}
theme={CheckboxTheme.Dark}
item={{id:"abc123",value:"abc123",label:"Torch"}}
isSelected={checked}
onChange={()=>setChecked(!checked)}
/>
</div>
</Card>
)
}
With multiple check boxes
You could make use of the toggleKey property to identify which item is being clicked, for cases where you don't want to define the onChange function in-line.