Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Dropdown

A labelled <select> control.

Import

from manywidgets import Dropdown

Example

from manywidgets import Dropdown

Dropdown(label="Chart type", options=["line", "bar", "scatter"], value="line")

API

TraitTypeDefaultDescription
optionsListScalars ([‘a’, ‘b’]) or [label, value] pairs.
valueAnyNoneThe selected value.
labelUnicode''Label shown above the dropdown.
widget_idUnicode''Stable unique id used for cross-widget linking (auto-assigned).

options is a list of scalars or [label, value] pairs.

Linking

Link like any widget (see the linking guide):

from ipywidgets import jsdlink
from manywidgets import Chart, Dropdown

chart = Chart()
kind = Dropdown(options=["line", "bar", "scatter"], value="line")
jsdlink((kind, "value"), (chart, "chart_type"))