Don't forget to set the id
attribute on input and the for
attribute on label with the same value to get it work. This will link the label to the checkbox and then handle the click.
Please note that due to CSS limitations the structure of the checkbox is different than the one provided as example in Bulma's documentation.(Input is not wrapped by the label)
<div class= "field" >
<input id= "switchRoundedOutlinedDefault" type= "checkbox" name= "switchRoundedOutlinedDefault" class= "switch is-rounded is-outlined" checked= "checked" >
<label for= "switchRoundedOutlinedDefault" > Switch rounded outlined default</label>
</div>
<div class= "field" >
<input id= "switchRoundedOutlinedSuccess" type= "checkbox" name= "switchRoundedOutlinedSuccess" class= "switch is-rounded is-outlined is-success" checked= "checked" >
<label for= "switchRoundedOutlinedSuccess" > Switch rounded outlined success</label>
</div>
<div class= "field" >
<input id= "switchRoundedOutlinedWarning" type= "checkbox" name= "switchRoundedOutlinedWarning" class= "switch is-rounded is-outlined is-warning" checked= "checked" >
<label for= "switchRoundedOutlinedWarning" > Switch rounded outlined warning</label>
</div>
<div class= "field" >
<input id= "switchRoundedOutlinedDanger" type= "checkbox" name= "switchRoundedOutlinedDanger" class= "switch is-rounded is-outlined is-danger" checked= "checked" >
<label for= "switchRoundedOutlinedDanger" > Switch rounded outlined danger</label>
</div>
<div class= "field" >
<input id= "switchRoundedOutlinedInfo" type= "checkbox" name= "switchRoundedOutlinedInfo" class= "switch is-rounded is-outlined is-info" checked= "checked" >
<label for= "switchRoundedOutlinedInfo" > Switch rounded outlined info</label>
</div>
<div class= "field" >
<input id= "switchThinRoundedOutlinedDefault" type= "checkbox" name= "switchThinRoundedOutlinedDefault" class= "switch is-thin is-rounded is-outlined" checked= "checked" >
<label for= "switchThinRoundedOutlinedDefault" > Switch Thin rounded outlined default</label>
</div>
<div class= "field" >
<input id= "switchThinRoundedOutlinedSuccess" type= "checkbox" name= "switchThinRoundedOutlinedSuccess" class= "switch is-thin is-rounded is-outlined is-success" checked= "checked" >
<label for= "switchThinRoundedOutlinedSuccess" > Switch Thin rounded outlined success</label>
</div>
<div class= "field" >
<input id= "switchThinRoundedOutlinedWarning" type= "checkbox" name= "switchThinRoundedOutlinedWarning" class= "switch is-thin is-rounded is-outlined is-warning" checked= "checked" >
<label for= "switchThinRoundedOutlinedWarning" > Switch Thin rounded outlined warning</label>
</div>
<div class= "field" >
<input id= "switchThinRoundedOutlinedDanger" type= "checkbox" name= "switchThinRoundedOutlinedDanger" class= "switch is-thin is-rounded is-outlined is-danger" checked= "checked" >
<label for= "switchThinRoundedOutlinedDanger" > Switch Thin rounded outlined danger</label>
</div>
<div class= "field" >
<input id= "switchThinRoundedOutlinedInfo" type= "checkbox" name= "switchThinRoundedOutlinedInfo" class= "switch is-thin is-rounded is-outlined is-info" checked= "checked" >
<label for= "switchThinRoundedOutlinedInfo" > Switch Thin rounded outlined info</label>
</div>
You can use these variables to customize this component. Simply set one or multiple of these variables before importing Bulma. Learn how .