Foundation Switch
A switch toggles between the "On" and "Off" states when clicked with the mouse (tapped with a finger):
To toggle a switch, use Try it » Use "switch large" ... ... "switch small" ... "switch tiny" ... < /div Try it » Use ... "switch radius" ... "switch round" ... < /div Try it » You can set up a single option by using radio buttons (radio).Note: Note that each option's Try it » , element's for attribute needs to match the id of :
Example
<
div
class=
"switch"
<
input
id=
"mySwitch"
type=
"checkbox"
<
label
for=
"mySwitch"
<
/label
<
/div
Switch size
.large, .small or .tiny class to set the switch size:Example
<
div
class=<
/div
<
div
class=
"switch"<
/div
<
div
class=<
/div
<
div
class=
Rounded toggle switch
.radius and .round class to set a rounded toggle switch:Example
<
div
class=
"switch"<
/div
<
div
class=<
/div
<
div
class=
Switch group
name attribute must be consistent (in the example it is "myGroup").Example
<
div
class=
"switch"
<
input
id=
"mySwitch1"
type=
"radio"
name=
"myGroup"
<
label
for=
"mySwitch1"
<
/label
<
/div
<
div
class=
"switch"
<
input
id=
"mySwitch2"
type=
"radio"
name=
"myGroup"
checked
<
label
for=
"mySwitch2"
<
/label
<
/div