[[using-shell-components-ui-multiselect]]
= Multi Select

ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]

The multi select component asks a user to select multiple items from a list.
The following listing shows an example:

[source, java, indent=0]
----
include::{snippets}/UiComponentSnippets.java[tag=snippet7]
----

The following screencast shows a typical multi-select component:

[asciinema,rows=9]
----
include::example$component-multi-select-1.cast[]
----

The context object is `MultiItemSelectorContext`. The following table describes its context variables:

[[multiitemselectorcontext-template-variables]]
.MultiItemSelectorContext Template Variables
|===
|Key |Description

|`values`
|The values returned when the component exists.

|`rows`
|The visible items, where rows contain maps of name, selected, on-row, and enabled items.

|`model`
|The parent context variables (see xref:components/ui/render.adoc#selectorcomponentcontext-template-variables[SelectorComponentContext Template Variables]).
|===
