base-ui-svelte

Checkbox Group

A set of checkboxes for selecting multiple options.

View as Markdown
Apples

API Reference

Props mirror Base UI React where applicable, adapted for Svelte 5. Native HTML attributes for the rendered element are also accepted unless noted.

CheckboxGroup

Provides a shared state to a series of checkboxes.

Props

value string —
Name
value
Description

Controlled value.

Type
string[] | undefined
defaultValue string —
Description

Uncontrolled initial value.

Type
string[]
onValueChange function —
Description

Event handler called when the value changes.

Type
((value: string[], event: Event) => void) | undefined
disabled boolean false
Description

Whether the control ignores user interaction.

Type
boolean
Default
false
allValues string —
Description

Values controlled by a parent checkbox (parent on Checkbox.Root).

Type
string[] | undefined
children snippet —
Description

Content rendered inside the part.

Type
Snippet<[{ value: string[]; disabled: boolean }]>

Data attributes

AttributeDescription
data-disabledPresent when the checkbox group is disabled.