Those toggles actually mimic real hardware that used to be fairly common. I find those should be preferred over checkboxes for anything that takes immediate effect. If they don't, and you're collecting a bunch of options at once, in a form, then use checkboxes.