<jupyter_start><jupyter_text>The ``Select`` widget allows selecting a ``value`` from a list or dictionary of ``options`` by selecting it from a dropdown menu or selection area. It falls into the broad category of single-value, option-selection widgets that provide a compatible API and include the [``RadioBoxGroup``](RadioBoxGroup.ipynb), [``AutocompleteInput``](AutocompleteInput.ipynb) and [``DiscreteSlider``](DiscreteSlider.ipynb) widgets.For more information about listening to widget events and laying out widgets refer to the [widgets user guide](../../user_guide/Widgets.ipynb). Alternatively you can learn how to build GUIs by declaring parameters independently of any specific widgets in the [param user guide](../../user_guide/Param.ipynb). To express interactivity entirely using Javascript without the need for a Python server take a look at the [links user guide](../../user_guide/Param.ipynb). Parameters:For layout and styling related parameters see the [customization user guide](../../user_guide/Customization.ipynb). Core* **``options``** (list or dict): A list or dictionary of options to select from* **``groups``** (dict): A dictionary whose keys are used to visually group the options and whose values are either a list or a dictionary of options to select from. Mutually exclusive with ``options``* **``size``** (int): Declares how many options are displayed at the same time. If set to 1 displays options as dropdown otherwise displays scrollable area.* **``value``** (object): The current value; must be one of the option values Display* **``disabled``** (boolean): Whether the widget is editable* **``name``** (str): The title of the widget___<jupyter_code>select = pn.widgets.Select(name='Select', options=['Biology', 'Chemistry', 'Physics'])

select<jupyter_output><empty_output><jupyter_text>Like most other widgets, ``Select`` has a value parameter that can be accessed or set:<jupyter_code>select.value<jupyter_output><empty_output><jupyter_text>The `options` parameter also accepts a dictionary whose keys are going to be the labels of the dropdown menu.<jupyter_code>select = pn.widgets.Select(name='Select', options={'Biology': 1, 'Chemistry': 2})

select
select.value<jupyter_output><empty_output><jupyter_text>Updating the value will display the right label.<jupyter_code>select.value = 2<jupyter_output><empty_output><jupyter_text>The items displayed in the dropdown menu can be grouped visually (also known as *optgroup*) by setting the `groups` parameter **instead of** `options`. `groups` accepts a dictionary whose keys are used to group the options and whose values are defined similarly to how `options` are defined.<jupyter_code>select = pn.widgets.Select(name='Select', groups={'Europe': ['Greece', 'France'], 'Africa': ['Algeria', 'Congo']})

select
select.value<jupyter_output><empty_output><jupyter_text>Instead of a dropdown menu we can also select one option from a list by rendering multiple options at once using the `size` parameter:<jupyter_code>select_area = pn.widgets.Select(name='Select', options=['Biology', 'Chemistry', 'Physics'], size=3)

select_area<jupyter_output><empty_output><jupyter_text>ControlsThe `Select` widget exposes a number of options which can be changed from both Python and Javascript. Try out the effect of these parameters interactively:<jupyter_code>pn.Row(select.controls(jslink=True), select)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11088295687885011, 'fraction_numerical': 0.0014667057788207685, 'mean_word_length': 6.611607142857143, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '316079', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 960, 'n_tokens_neox': 924, 'n_words': 374, 'path': 'examples/reference/widgets/Select.ipynb', 'repo_name': 'blelem/panel', 'size': '3409'}