import panel as pn
pn.extension()
The CheckBoxGroup
widget allows selecting between a list of options by ticking the corresponding checkboxes. It falls into the broad category of multi-option selection widgets that provide a compatible API and include the MultiSelect
, CrossSelector
and CheckButtonGroup
widgets.
For more information about listening to widget events and laying out widgets refer to the widgets user guide. Alternatively you can learn how to build GUIs by declaring parameters independently of any specific widgets in the param user guide. To express interactivity entirely using Javascript without the need for a Python server take a look at the links user guide.
For layout and styling related parameters see the customization user guide.
options
(list or dict): List or dictionary of optionsvalue
(boolean): Currently selected optionsdisabled
(boolean): Whether the widget is editableinline
(boolean): Whether to arrange the items vertically in a column (False
) or horizontally in a line (True
)name
(str): The title of the widgetcheckbox_group = pn.widgets.CheckBoxGroup(
name='Checkbox Group', value=['Apple', 'Pear'], options=['Apple', 'Banana', 'Pear', 'Strawberry'],
inline=True)
checkbox_group
CheckBoxGroup.value
returns a list of the currently selected options:
checkbox_group.value
The CheckboxBoxGroup
widget exposes a number of options which can be changed from both Python and Javascript. Try out the effect of these parameters interactively:
pn.Row(checkbox_group.controls(jslink=True), checkbox_group)