mo.ui.multiselect
Create a multiselect dropdown for selecting multiple options.
Signature
mo.ui.multiselect(
options: Sequence[str] | dict[str, Any],
value: Sequence[str] | None = None,
*,
label: str = "",
on_change: Callable[[list[object]], None] | None = None,
full_width: bool = False,
max_selections: int | None = None
)
Parameters
options
Sequence[str] | dict[str, Any]
required
List of options or dictionary mapping labels to values
Initially selected values
Markdown label for the multiselect
Whether multiselect takes full width
Maximum number of selections allowed
Examples
import marimo as mo
# Basic multiselect
fruits = mo.ui.multiselect(
options=["Apple", "Banana", "Cherry", "Date"],
label="**Select fruits:**"
)
fruits
# With initial selection
selected = mo.ui.multiselect(
options=["Python", "JavaScript", "Rust", "Go"],
value=["Python"],
label="Programming languages"
)
mo.md(f"You selected: {', '.join(selected.value)}")
# Limited selections
top_three = mo.ui.multiselect(
options=["A", "B", "C", "D", "E"],
max_selections=3,
label="Pick your top 3"
)