Skip to main content
HomeFormCheckbox
warning
This is a beta release of the Quantum web libraries
Please be careful when using them in production, as they may contain bugs, unstable breaking changes, and incomplete features.

Checkbox

Checkboxes allow users to select multiple options from a list, or to mark an individual item as selected.

Sizes

Checkboxes are available in three sizes to cater for the diverse range of use cases and devices that our business uses. By default, the checkbox has size="medium".

Small

Medium

Large

<QtmCheckbox size="small" checked>Small</QtmCheckbox>
<QtmCheckbox size="medium" checked>Medium</QtmCheckbox>
<QtmCheckbox size="large" checked>Large</QtmCheckbox>

Selection

Checkboxes can be unchecked, checked, or in an indeterminate state.

UncheckedCheckedIndeterminate
<QtmCheckbox>Unchecked</QtmCheckbox>
<QtmCheckbox checked>Checked</QtmCheckbox>
<QtmCheckbox indeterminate>Indeterminate</QtmCheckbox>

Colors

Checkboxes are available in two colors: primary and neutral. The default color is the primary color.

UncheckedCheckedIndeterminate
Unchecked

Checked

Indeterminate

<QtmCheckbox color="primary">Unchecked</QtmCheckbox> ...

Errors

Checkboxes can also have an error state to show that a selection needs to be made in order to move forward, or that a selection that was made is invalid.

Unchecked

Checked

Indeterminate

<QtmCheckbox error>Unchecked</QtmCheckbox> ...

Disabled

Checkboxes can also have a disable state.

Unchecked

Checked

Indeterminate

<QtmCheckbox disabled>Unchecked</QtmCheckbox> ...

Required

If a checkbox has the attribute required, it has to be checked.

<QtmCheckbox required>Checkbox</QtmCheckbox>

InputId

The id of the checkbox element

<QtmCheckbox inputId="checkbox">Checkbox</QtmCheckbox>

Label

The label of the checkbox element. When label attribute is set, the text of the checkbox is set to the same.

<QtmCheckbox label="Check Box" />

Custom labels

Checkbox accepts any component as its label. Make sure to use items with clear textual labels, or elements that are self explanatory in the given context.

Option 1

This is some placeholder help text.

<QtmCheckbox>
<div>
<QtmTypography>Option 1</QtmTypography>
<QtmTypography component="caption-1" classes="text-bluegrey-500">
This is some placeholder help text.
</QtmTypography>
</div>
</QtmCheckbox>

Checkbox Group

QtmCheckboxGroup is a helpful wrapper used to group checkbox elements.

Checkbox 1Checkbox 2Checkbox 3
<QtmCheckboxGroup>
<QtmCheckbox checked>Checkbox 1</QtmCheckbox>
<QtmCheckbox>Checkbox 2</QtmCheckbox>
<QtmCheckbox>Checkbox 3</QtmCheckbox>
</QtmCheckboxGroup>

Sizes

QtmCheckboxGroup are available in three sizes that correspond to the different bottom margin values and size of their child elements. By default, the medium size is used.

SmallCheckbox 1Checkbox 2Checkbox 3MediumCheckbox 1Checkbox 2Checkbox 3LargeCheckbox 1Checkbox 2Checkbox 3
<QtmCheckboxGroup size="small">
<QtmCheckbox checked>Checkbox 1</QtmCheckbox>
...
</QtmCheckboxGroup>
...

API

Checkbox

Loading API documentation...

CheckboxGroup

Loading API documentation...

Spotted a bug, have a question, or want to suggest a new feature?

Submit an issue on GitLab