---
title: Examples
slug: wip/iWLb-examples
createdAt: 2023-07-20T14:45:03.180Z
---

# Examples

## Basic Usage

A group of Checkboxes is set up by setting a descriptive label for the group.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/poKqEjx/da3c4fea1d4fb859fe79d5734e25f8e6?default-tab=html%2Cresult&#x26;amp;theme-id=39623&#x26;amp;editable=true&#x22; height=&#x22;318px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Extended Usage

Checkboxes within a Checkbox Group can use all their features to create rich user experiences.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/poZNjrQ/0076279b23884dcfe29b3bfb7bbe3b34?default-tab=html%2Cresult&#x26;amp;theme-id=39623&#x26;amp;editable=true&#x22; height=&#x22;356px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Help Text

The help text serves the purpose of guiding a user's decision by providing additional information.

A help text can either be passed as an attribute for simple string-based content or via a slot for rich formatted content.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/vYrvXLy/311737b4ab2f486bc3422a1b0483585d?default-tab=html%2Cresult&#x26;amp;theme-id=39623&#x26;amp;editable=true&#x22; height=&#x22;577px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Required and Optional

Adding a required or optional label helps users to be guided while filling out a form. Usually, only Checkbox Groups that are an exception to the majority of other form fields in a form are marked as required or optional. For example, a Checkbox Group is marked as "Required" when the majority of the fields in the same form are optional and vice versa.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/gOjgBGJ/7a2bc79f61c65c3aeb260f35b7ca16cd?default-tab=html%2Cresult&#x26;amp;theme-id=39623&#x26;amp;editable=true&#x22; height=&#x22;347px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Validation

A Checkbox Group's validity can either be determined automatically when used inside a form or can be controlled from outside based on custom rules and application business logic.

### Inside a Form

Checkbox Groups seamlessly integrate into a form's validation workflows and validate when a form is submitted. When no custom validation message is provided, the Checkbox falls back to the browser's native validation message.

:::hint{type="info"}
**💡Did you know?**

A Checkbox Group that contains required Checkboxes expects at least one option to be ticked. Setting one Checkbox as required has the same effect as setting all of them to be required.
:::

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/rNKoMeg/1ce5493bf1b3b0be7689d2ddfe987a3d?default-tab=html%2Cresult&#x26;amp;theme-id=39623&#x26;amp;editable=true&#x22; height=&#x22;446px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

### Inside an application

The validity of a Checkbox Group can also be controlled from outside based on custom rules or other business logic of an application. When flagged as invalid, a Checkbox Group expects a descriptive validation message to be set alongside.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/QWxzKEB/e06d145ecfda4d7958fe50d9f42d0870?default-tab=html%2Cresult&#x26;amp;theme-id=39623&#x26;amp;editable=true&#x22; height=&#x22;356px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Disabled

An entire Group of Checkboxes can be marked as disabled.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/wvXVexE/1b1c3fb6c3ebe96449ed213e4781a935?default-tab=html%2Cresult&#x26;amp;theme-id=39623&#x26;amp;editable=true&#x22; height=&#x22;406px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

:::hint{type="info"}
**💡 Did you know?**

It is also possible to disable individual Checkboxes.
:::

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/XWYvZzB/65a1802de8fc661d761625ca50055607?default-tab=html%2Cresult&#x26;amp;theme-id=39623&#x26;amp;editable=true&#x22; height=&#x22;406px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

