---
title: "init(_:systemImage:content:primaryAction:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/menu/init(_:systemimage:content:primaryaction:)"
---

# init(_:systemImage:content:primaryAction:)

Creates a menu with a custom primary action that generates its label from a localized string key and system image.

## Declaration

```swift
nonisolated init(_ titleKey: LocalizedStringKey, systemImage: String, @ContentBuilder content: () -> Content, primaryAction: @escaping () -> Void)
```

## Parameters

- `titleKey`: The key for the link’s localized title, which describes the contents of the menu.
- `systemImage`: The name of the image resource to lookup.
- `content`: A group of menu items.
- `primaryAction`: The action to perform on primary interaction with the menu.

## See Also

### Creating a menu with a primary action

- [init(_:content:primaryAction:)](swiftui/menu/init(_:content:primaryaction:).md)
- [init(content:label:primaryAction:)](swiftui/menu/init(content:label:primaryaction:).md)
- [init(_:image:content:primaryAction:)](swiftui/menu/init(_:image:content:primaryaction:).md)
