--- layout: layouts/component.njk title: Checkbox description: A control that allows the user to toggle between checked and not checked. toc: - label: Usage id: usage - label: Examples id: examples children: - label: Disabled id: example-disabled - label: With text id: example-with-text - label: Form id: example-form --- {% from "macros/code_preview.njk" import code_preview %} {% from "macros/code_block.njk" import code_block %} {% set code %}{% endset %} {{ code_preview("checkbox", code) }}
Simply add the input class to your <input type="radio"> elements or have a parent with the form class (read more about form). You can also set the aria-invalid attribute to true to make the input invalid.
By clicking this checkbox, you agree to the terms and conditions.