<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Menu/init(_:systemImage:content:primaryAction:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4MenuVA2A5LabelVyAA4TextVAA5ImageVGRszrlE_06systemF07content13primaryActionACyAJq_GAA18LocalizedStringKeyV_SSq_yXEyyctcfc::OverloadGroup"
  },
  "title" : "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.

```
@export(implementation) 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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)