Switch

The Switch component is used to switch between two options and the result of the change is immediate.

DetailsProperties

Introduction

The Switch component is used as an alternative for the Checkbox component. Except indeterminate and label are not supported.

Switch states

Sizes

The Switch will work with any height you pass it. Although it’s only ever used with: 16, 20 and 24.

Controlled usage

The Switch component passes on the original event through the onChange handler. Use e.target.checked to get the latest value and update state accordingly.