---
title: CommandMenu
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/commandmenu
---

# CommandMenu

Command menus are stand-alone, top-level containers for controls that perform related, app-specific commands.

## Declaration

```swift
nonisolated struct CommandMenu<Content> where Content : View
```

## Mentioned in

Building and customizing the menu bar with SwiftUI Grouping data with lazy stack views

## Overview

Overview Command menus are realized as menu bar menus on macOS, inserted between the built-in View and Window menus in order of declaration. On iOS, iPadOS, and tvOS, SwiftUI creates key commands for each of a menu’s commands that has a keyboard shortcut.

## Topics

### Creating a command menu

- [init(_:content:)](swiftui/commandmenu/init(_:content:).md)

## Relationships

### Conforms To

- [Commands](swiftui/commands.md)

## See Also

### Defining commands

- [commands(content:)](swiftui/scene/commands(content:).md)
- [commandsRemoved()](swiftui/scene/commandsremoved().md)
- [commandsReplaced(content:)](swiftui/scene/commandsreplaced(content:).md)
- [Commands](swiftui/commands.md)
- [CommandGroup](swiftui/commandgroup.md)
- [CommandsBuilder](swiftui/commandsbuilder.md)
- [CommandGroupPlacement](swiftui/commandgroupplacement.md)
