> Markdown version of [ListSelect](https://vaadin.com/docs/v8/framework/components/components-listselect). Section index: [llms.txt](https://vaadin.com/docs/v8/framework/llms.txt)

# <a id="components.listselect"></a>ListSelect

[Demo](https://demo.vaadin.com/sampler/#ui/data-input/multiple-value/list-select)

The ListSelect component is list box that shows the selectable items in a vertical list. If the number of items exceeds the height of the component, a scrollbar is shown. The component allows selecting multiple values.

```java
// Create the selection component
ListSelect<String> select = new ListSelect<>("The List");

// Add some items
select.setItems("Mercury", "Venus", "Earth", ...);

// Show 5 items and a scrollbar if there are more
select.setRows(5);

select.addValueChangeListener(event -> {
    Set<String> selected = event.getValue();
    Notification.show(selected.size() + " items.");
});
```

The number of visible items is set with setRows().

[Image: listselect basic]

The ListSelect Component

Common selection component features are described in ["Selection Components"](https://vaadin.com/docs/v8/framework/components/components-selection.md#components.selection).

## <a id="css-style-rules"></a>CSS Style Rules

```css
.v-select {}
  .v-select-select {}
    option {}
```

The component has an overall v-select style. The native \<select> element has v-select-select style. The items are represented as \<option> elements.
