# Selection

The ListBox provides single and multiple item selection modes that allow users to select one or more items from the list.

To configure the selection mode, use the [`selectable`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/listboxcomponent#selectable) input. The ListBox supports the following selection modes:

* `single` (default)—Allows the user to select only one item at a time.
* `multiple`—Allows the user to select multiple items.

## Single Selection

By default, the ListBox uses single selection mode. Users can select one item at a time by clicking on it.

The following example shows single selection in practice: users pick one item from a country list and the selection details appear in a dedicated info panel below.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/listbox/selection/single/source.txt)

## Multiple Selection

To enable multiple selection, set the [`selectable`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/listboxcomponent#selectable) input to `multiple`. Users can select multiple items by holding `Ctrl` or `Cmd` (MacOS) while clicking, or by using keyboard shortcuts such as `Ctrl + Space`, `Shift + Click`, or `Shift + Arrow` keys. [Read more about keyboard navigation...](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/keyboard-navigation)

```html
<kendo-listbox [data]="items" selectable="multiple"></kendo-listbox>
```

The following example shows multiple selection mode with two connected ListBox components, where users can select and transfer products between **Available Products** and **Added to List** panels using `Ctrl`/`Cmd` or `Shift` key combinations.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/listbox/selection/multiple/source.txt)

## Programmatic Selection

The ListBox provides methods and fields to programmatically access and manipulate the selected items:

* [`selectedIndices`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/listboxcomponent#selectedindices)—Provides access to the indices of the currently selected items as an array of numbers.
* [`select(indices)`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/listboxcomponent#select)—Accepts an array of numbers that correspond to indices in the ListBox and selects them.

The following example demonstrates how to use these APIs to programmatically select items and react to selection changes.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/listbox/selection/programmatic/source.txt)

## Persisting Selection

The ListBox selection state can be persisted across page refreshes or sessions. The following example demonstrates how to save and restore the selected indices using [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage). You can also use other storage mechanisms such as [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage), cookies, or backend APIs to persist the selection state.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/listbox/selection/persist/source.txt)

## Suggested Links

* [API Reference of the ListBox](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api)
* [Keyboard Navigation](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/keyboard-navigation)
