# Multi select List

The CarbonListComponent supports a multi-select feature. To enable this the following steps must be followed:

1. Set the input in the template:

   **`sample.component.html`**

   ```angular2html
   <valtimo-carbon-list
   [items]="items"
   [fields]="fields"
   [showSelectionColumn]="true"
   > </valtimo-carbon-list>
   ```
2. Set the buttons for your multi-select actions:

   **`sample.component.html`**

   ```angular2html
   <valtimo-carbon-list
   [items]="items"
   [fields]="fields"
   [showSelectionColumn]="true"
   >
    <ng-container carbonToolbarActions>
      <button cdsButton="primary" (click)="sampleAction()">
        Sample button
      </button>
    </ng-container>
   </valtimo-carbon-list>
   ```
3. Add handler for action:

   **`sample.component.ts`**

   ```typescript
   ...
   import {CarbonListComponent} from '@valtimo/components';
   ...
   export class SampleComponent {
    ...
    // We need access to the carbonListComponent in order to get the selected items.

    @ViewChild(CarbonListComponent) carbonListComponent: CarbonListComponent<any>;

    ...
    public sampleAction(): void {
        const selectedItems = this.carbonList.selectedItems;
        // Code to process selected items
    }
    ...
   }
   ...
   ```

This will create a list with multi-select enabled:

![list-with-multi-select.png](/files/qVSyXQyY16HINitZ2nXx)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.valtimo.nl/v12/nog-een-plek-geven/reference/user-interface/list-with-multi-select.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
