Dark Light
System
Default LBBW Jira Confluence Source Code
Share
Playground

Checkbox Group

<afp-checkbox-group> Since 1.0.0 stable This component uses the light DOM, so its markup and styles are part of the regular document flow.

A checkbox group component to display multiple checkboxes together.

Banana Apple Orange

Examples #

Label #

Use the label attribute or slot to provide a label for the checkbox group.

John Doe Jane Doe Online Alex Smith

Hint #

Use the hint attribute to provide additional information below the checkbox group.

Red Blue Green

Value #

Use the value attribute to set the initial selected checkboxes.

Rock Jazz Pop

Disabled #

Use the disabled attribute to render the entire checkbox group in the disabled state.

Technology Science Design

Invalid #

Use the invalid attribute to render a checkbox in the invalid state with an error message.

Email SMS Push Notifications

Event Handling #

Use the afp-value-changed event to listen for value changes.

Weather Tasks News

Properties

Learn more about properties.

Name Description Reflects
value
value of the checkbox group
Type string[]
label
Group label
Type string
hideLabel
hidelabel
hides the label visually
Type boolean
hint
hint footer property of checkbox group
Type string
invalid
Error message shown below the checkbox when present. Sets `aria-invalid`. Provide a non-empty string to put the component in an error state.
Type string
disabled
Disable all checkboxes in the group (unless the child has explicit disabled attribute)
Type boolean
Default false
shape
shape of the checkbox group
Type
AfpShape
Name Description
PILL
Makes the component circular.
ROUNDED
Makes the component rounded.
SOFT
Makes the component have soft edges.
SQUARE
Makes the component square.
AfpShape
Default AfpShape.ROUNDED
size
size of the checkboxes.
Type
AfpSize
Name Description
SMALL
Small size with compact dimensions.
MEDIUM
Medium size with standard dimensions.
LARGE
Large size with expanded dimensions.
AfpSize
Default AfpSize.MEDIUM
componentId
Unique component ID
Default `afp-checkbox-group-${++id}`

Events

Learn more about events.

Name Return Description
afp-value-changed string[]
Emitted when the value of the checkbox group changes.

Slots

Learn more about slots.

Name Description
default
The default slot.
label
Slot for the checkbox group label.

Internationalization

Learn more about internationalization.

Key Description
checkbox-group.aria-label
The default `aria-label` text for Checkbox Group

CSS Parts

Learn more about CSS Parts.

Name Description Selector
base
The checkbox group container wrapper.
::part(base)
label
The checkbox group label.
::part(label)
items
The container for the checkbox items.
::part(items)
invalid
The error message container.
::part(invalid)
hint
The hint text container.
::part(hint)

CSS Custom Properties

Name Description Default
--afp-input-error-message-color
The color of the error message in the invalid/error state.
--afp-color-error-500

Dependencies

The component automatically brings in the listed items, including any nested dependencies that may exist.

afp-checkbox

Importing

Using the bundle is the recommended method to include components. If you’d rather handle imports manually, you can use the code examples below.

import '@afp-design-system/core/dist/components/checkbox-group/checkbox-group.js';
Share
Create a link with a predefined theme that is automatically applied when the generated link is opened. Default LBBW Presentation Mode
Abort Copy Link