checkboxGroup

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 = {}): Div

This component generates a group of checkboxes. So this component should be used if a user should be able to choose multiple values from a list of options.

The function requires a list of items T as mandatory parameter, representing the pool of choices. Clients should also consider to pass a Store> too, in order to let the component manage the selected items and also use this for preselection.

Example usage

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

See also

Parameters

styling

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

items

a list of all available options

values

a store of List

baseClass

optional CSS class that should be applied to the element

id

the ID of the element

prefix

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

build

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