Switch is a 40 by 24 track with a knob that slides to the end when on. A tap anywhere on the row, label included, toggles it. See the web Switch for the same component in the browser.
Pass checked and update it in onToggle, which gets the next state.
loading shows a spinner in the knob and ignores taps, for a setting that is saving. reverse puts the switch after the label, as a settings list does.
- The handler is onToggle(checked). There is no name, value or form submission.
- The knob widens while pressed, in place of the hover state.
- A switch without a label takes taps from 44pt around it. Give it ariaLabel so screen readers can name it.