<!--
{
  "availability" : [
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/MenuBarExtra/init(_:content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI12MenuBarExtraVA2A4TextVRszrlE_7contentACyAEq_G10Foundation23LocalizedStringResourceV_q_yXEtcfc::OverloadGroup"
  },
  "title" : "init(_:content:)"
}
-->

# init(_:content:)

Creates a menu bar extra with a localized resource for a localized
string to use as the label. The extra defines the primary scene of an
`App`.

```
@export(implementation) nonisolated init(_ titleResource: LocalizedStringResource, @ContentBuilder content: () -> Content)
```

## Parameters

`titleResource`

The title resource to use for the label of the item.

`content`

A `View` to display when the user selects the item.

## Discussion

When this item is removed from the system menu bar by the user,
the application will be automatically quit. As such, it should not be
used in conjunction with other scene types in your `App`.

---

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)