fun <T> RenderContext.checkboxGroup(styling: BasicParams.() -> Unit = {}, items: List<T>, values: Store<List<T>>? = null, baseClass: StyleClass = StyleClass.None, id: String? = null, prefix: String = "checkboxGroupComponent", build: CheckboxGroupComponent<T>.() -> Unit = {})

This component generates a group of checkboxes.

You can set different kind of properties like the label text or different styling aspects like the colors of the background, the label or the checked state. Further more there are configuration functions for accessing the checked state of each box or totally disable it. For a detailed overview about the possible properties of the component object itself, have a look at CheckboxGroupComponent

Example usage

// simple use case showing the core functionality
val options = listOf("A", "B", "C")
val myStore = storeOf(<List<String>>)
checkboxGroup(items = options, values = myStore) {

// use case showing some styling options and a store of List<Pair<Int,String>>
val myPairs = listOf((1 to "ffffff"), (2 to "rrrrrr" ), (3 to "iiiiii"), (4 to "tttttt"), ( 5 to "zzzzzz"), (6 to "222222"))
val myStore = storeOf(<List<Pair<Int,String>>)
checkboxGroup(items = myPairs, values = myStore) {
label { it.second }
size { large }
checkedStyle {
background { color { "green" } }

See also



optional CSS class that should be applied to the element


a lambda expression for setting up the component itself. Details in CheckboxGroupComponent


the ID of the element


a list of all available options


the prefix for the generated CSS class resulting in the form `$prefix-$hash`


a lambda expression for declaring the styling as fritz2's styling DSL


a store of List<T>