---
title: DropDownMenu
description: DropDownMenu API.
---

import CodeSnippetMD from '@slint/common-files/src/components/CodeSnippetMD.astro';
import SlintProperty from '@slint/common-files/src/components/SlintProperty.astro';

<CodeSnippetMD imagePath="/src/assets/generated/menu1.png" scale="3" imageWidth="300" imageHeight="200" imageAlt="">
```slint
import { DropDownMenu } from "@material";
export component Example inherits Window {
    width: 400px;
    height: 300px;
    background: transparent;
    DropDownMenu {
        width: 280px;
        height: parent.height;
        items: [
          { text: "Copy" },
          { text: "Cut" },
          { text: "Paste" },
        ];
    }
}
```
</CodeSnippetMD>

A "DropDownMenu" that can be opened from a TextField. The selected menu item is displayed in that field.

## Properties

### items
<SlintProperty propName="items" typeName="[struct]" structName="MenuItem">
An array of menu items, each containing an icon, a text, and a trailing text.
</SlintProperty>

### enabled
<SlintProperty propName="enabled" typeName="bool" defaultValue="true">
Whether the drop down menu is enabled and can be interacted with.
</SlintProperty>

### leading_icon
<SlintProperty propName="leading-icon" typeName="image">
An icon displayed at the beginning of the drop down menu.
</SlintProperty>

### label
<SlintProperty propName="label" typeName="string">
The label text displayed above the drop down menu.
</SlintProperty>

### current_index
<SlintProperty propName="current-index" typeName="int" propertyVisibility="in-out">
The index of the currently selected menu item.
</SlintProperty>

## Callbacks

### selected(index: int)
Invoked when a menu item is selected
