Display a control which allows the user to toggle between checked and unchecked states and opltionally show a label associated with it.

Examples of Switch variants
Default switch
Disabled switch
Switch with a different fill color
Switch with label, default position
Airplane mode
Switch with label, positioned right
Airplane mode
Switch with label, positioned top
Airplane mode
Switch with label, positioned bottom
Airplane mode

For creating these system design components, I was inspired by shadcn/ui. Please check them out.
P.S. - You can also see the code samples attached with the examples. For a detailed view, you can see the code on github.