# PluginMenu

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Tags: Not creatable, Not replicated
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/PluginMenu/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/PluginMenu

A context menu that can be shown in Studio. Displays a list of `PluginActions` and supports submenus.

## Properties

### Icon

```luau
PluginMenu.Icon: string
```

- Tags: Not replicated, Load only

The icon to be displayed when used as a submenu.

### Title

```luau
PluginMenu.Title: string
```

- Tags: Not replicated, Load only

The text to be displayed when used as a submenu.

### Visible

```luau
PluginMenu.Visible: boolean
```

- Tags: Roblox script security

Determines whether the menu is shown when it is used as a submenu.

## Methods

### AddAction

```luau
PluginMenu:AddAction(action: Instance)
```

- Tags: Plugin security

Adds the given action to the menu.

Parameters:

- `action`: The action to add.

### AddMenu

```luau
PluginMenu:AddMenu(menu: Instance)
```

- Tags: Plugin security

Adds the given menu as a separator.

Parameters:

- `menu`: The menu to add as a submenu. Uses its [`Title`](https://rapi.sleaze.dev/classes/PluginMenu.md) and [`Icon`](https://rapi.sleaze.dev/classes/PluginMenu.md) to display.

### AddNewAction

```luau
PluginMenu:AddNewAction(actionId: string, text: string, icon: string? = ""): Instance
```

- Tags: Plugin security

Creates a temporary action that is hidden from Studio's customize shortcuts window.

Parameters:

- `actionId`: Must be a unique string that identifies this [`PluginAction`](https://rapi.sleaze.dev/classes/PluginAction.md) from others.
- `text`: The text to be displayed.
- `icon`: The icon to be displayed.

Returns: The created [`PluginAction`](https://rapi.sleaze.dev/classes/PluginAction.md).

### AddSeparator

```luau
PluginMenu:AddSeparator()
```

- Tags: Plugin security

Adds a separator between items in the menu.

### Clear

```luau
PluginMenu:Clear()
```

- Tags: Plugin security

Clears the menu.

### ShowAsync

```luau
PluginMenu:ShowAsync(): Instance
```

- Tags: Yields, Plugin security

Shows the menu at the mouse cursor. Yields until either an item is selected or the menu is closed.

Returns: The [`PluginAction`](https://rapi.sleaze.dev/classes/PluginAction.md) item that was selected or `nil`.

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
