import panel as pn
pn.extension()
The CrossSelector
widget allows selecting multiple values from a list of options by moving items between two lists. It falls into the broad category of multi-option selection widgets that provide a compatible API and include the MultiSelect
, CheckBoxGroup
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.
definition_order
(boolean, default=True): Whether to preserve definition order after filtering. Disable to allow the order of selection to define the order of the selected list.filter_fn
(function): The filter function applied when querying using the text fields, defaults to re.search. Function is two arguments, the query or pattern and the item label.options
(list or dict): List or dictionary of available optionsvalue
(boolean): Currently selected optionsdisabled
(boolean): Whether the widget is editablename
(str): The title of the widgetThe CrossSelector
is made up of a number of components:
>>
) and vice versa (<<
)cross_selector = pn.widgets.CrossSelector(name='Fruits', value=['Apple', 'Pear'],
options=['Apple', 'Banana', 'Pear', 'Strawberry'])
cross_selector
CrossSelector.value
returns a list of the currently selected options:
cross_selector.value