Checkbox
Checkboxes toggle an option on or off. Put checkbox on a native <input type="checkbox"> and wrap it in a label.
Playground
Flip a class and watch it change. The markup below follows along.
<label class="label-inline">
<input type="checkbox" class="checkbox"> Accept terms
</label>Class names
| Class name | Type | Description |
|---|---|---|
checkbox | Component | Base checkbox, primary colored when checked |
checkbox-primary | Color | Primary color |
checkbox-secondary | Color | Secondary color |
checkbox-success | Color | Success |
checkbox-warning | Color | Warning |
checkbox-info | Color | Informational |
checkbox-danger | Color | Danger |
checkbox-sm | Size | Small |
checkbox-lg | Size | Large |
:checked | State | Filled with a check mark |
:indeterminate | State | Filled with a dash; set `indeterminate` from JS |
:disabled | State | Dimmed and not interactive |
Checkbox
<label class="label-inline">
<input type="checkbox" class="checkbox"> Accept terms
</label>Colors
<label class="label-inline"><input type="checkbox" class="checkbox checkbox-primary" checked> Primary</label>
<label class="label-inline"><input type="checkbox" class="checkbox checkbox-secondary" checked> Secondary</label>
<label class="label-inline"><input type="checkbox" class="checkbox checkbox-info" checked> Info</label>
<label class="label-inline"><input type="checkbox" class="checkbox checkbox-success" checked> Success</label>
<label class="label-inline"><input type="checkbox" class="checkbox checkbox-warning" checked> Warning</label>
<label class="label-inline"><input type="checkbox" class="checkbox checkbox-danger" checked> Danger</label>Sizes
Medium is the default; there is no checkbox-md class.
<label class="label-inline"><input type="checkbox" class="checkbox checkbox-sm" checked> Small</label>
<label class="label-inline"><input type="checkbox" class="checkbox" checked> Medium</label>
<label class="label-inline"><input type="checkbox" class="checkbox checkbox-lg" checked> Large</label>Checked
<label class="label-inline"><input type="checkbox" class="checkbox"> Unchecked</label>
<label class="label-inline"><input type="checkbox" class="checkbox" checked> Checked</label>Disabled
<label class="label-inline"><input type="checkbox" class="checkbox" disabled> Disabled</label>
<label class="label-inline"><input type="checkbox" class="checkbox" checked disabled> Disabled checked</label>Group
<fieldset>
<legend>Notify me about</legend>
<label class="label-inline"><input type="checkbox" class="checkbox" name="checkbox-ex6-notify" value="mentions" checked> Mentions</label><br>
<label class="label-inline"><input type="checkbox" class="checkbox" name="checkbox-ex6-notify" value="replies"> Replies</label><br>
<label class="label-inline"><input type="checkbox" class="checkbox" name="checkbox-ex6-notify" value="digest"> Weekly digest</label>
</fieldset>