---
title: "StandardListView"
description: "StandardListView api."
---
import SlintProperty from '@slint/common-files/src/components/SlintProperty.astro';
import CodeSnippetMD from '@slint/common-files/src/components/CodeSnippetMD.astro';
import Link from '@slint/common-files/src/components/Link.astro';

<CodeSnippetMD imagePath="/src/assets/generated/std-widgets-standardlistview.png"  imageWidth="200" imageHeight="200"  imageAlt='std-widgets standardlistview example'>
```slint
import { StandardListView, VerticalBox } from "std-widgets.slint";
export component Example inherits Window {
    width: 200px;
    height: 200px;

    VerticalBox {
        StandardListView {
            model: [ { text: "Blue"}, { text: "Red" }, { text: "Green" },
                { text: "Yellow" }, { text: "Black"}, { text: "White"},
                { text: "Magenta" }, { text: "Cyan" },
            ];
        }
    }
}
```
</CodeSnippetMD>

Like ListView, but with a default delegate, and a `model` property.

## Properties

Same as [ListView](/master/docs/slint/reference/std-widgets/views/listview.md), and in addition:

### current-item
<SlintProperty typeName="int" propName="current-item" defaultValue="-1" propertyVisibility="in-out">
The index of the currently active item. -1 mean none is selected, which is the default
</SlintProperty>

### model
<SlintProperty typeName="struct" structName="StandardListViewItem" propName="model" defaultValue="[]">
The model.

```slint 'model: [{ text: "Blue" }, { text: "Red" }, { text: "Green" }];'
StandardListView {
    model: [{ text: "Blue" }, { text: "Red" }, { text: "Green" }];
}
```
</SlintProperty>

## Functions

### set-current-item(int)
Sets the current item by the specified index and brings it into view.

## Callbacks

### current-item-changed(int)
Emitted when the current item has changed because the user modified it

```slint {3-5}
StandardListView {
    model: [{ text: "Blue" }, { text: "Red" }, { text: "Green" }];
    current-item-changed(index) => {
        debug("Current item: ", index);
    }
}
```

### item-pointer-event(int, PointerEvent, Point)
Emitted on any mouse pointer event similar to `TouchArea`. Arguments are item index associated with the event, the `PointerEvent` itself and the mouse position within the listview.