---
title: PopupMenu
description: PopupMenu 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/menu2.png" scale="3" imageWidth="300" imageHeight="200" imageAlt="">
```slint
import { PopupMenu } from "@material";
export component Example inherits Window {
    width: 400px;
    height: 300px;
    background: transparent;
    PopupMenu {
        width: 280px;
        height: parent.height;
        items: [
          { text: "Copy" },
          { text: "Cut" },
          { text: "Paste" },
        ];
    }
}
```
</CodeSnippetMD>

A `PopupMenu` to display a list of choices on a temporary surface.

## 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>

## Callbacks

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