Overview
Checkboxes are for selecting one or several options from a list of many and are predominantly used within forms. They are stacked vertically by default.
Examples
Static variation
<div class="checkbox" data-required-min="1" required>
<fieldset>
<legend>Choose your options</legend>
<div class="checkbox__group">
<label for="formCheckbox-1" class="checkbox__label">
Option 1
<input type="checkbox" name="formCheckbox" id="formCheckbox-1" class="checkbox__field" data-validator="checbox_required">
<span class="checkbox__indicator"></span>
</label>
</div>
<div class="checkbox__group">
<label for="formCheckbox-2" class="checkbox__label">
Option 2
<input type="checkbox" name="formCheckbox" id="formCheckbox-2" class="checkbox__field" data-validator="min_required">
<span class="checkbox__indicator"></span>
</label>
</div>
<div class="checkbox__group">
<label for="formCheckbox-3" class="checkbox__label">
Option 3
<input type="checkbox" name="formCheckbox" id="formCheckbox-3" class="checkbox__field" data-validator="min_required">
<span class="checkbox__indicator"></span>
</label>
</div>
</fieldset>
</div>
Usage guidelines
Dos | Donts |
---|---|
|
|
|
|
|
Implementation guidelines
Name | Attribute | Description |
---|---|---|
Required |
required
|
Requires a value to be selected - cannot be left empty. Minimum of one inputs must be checked. Apply to the .checkbox element.
|
Minimum required |
data-required-min
|
Specify how many Checkboxes in the group must be checked in order to pass validation. |