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

# init(_:isInserted:content:)

Creates a menu bar extra with a localized resource for a localized
string to use as the label. The item will be displayed in the system
menu bar when the specified binding is set to `true`. If the user
removes the item from the menu bar, the binding will be set to `false`.

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

## Parameters

`titleResource`

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

`isInserted`

Whether the item is inserted in the menu bar. The item
may or may not be visible, depending on the number of items present.

`content`

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

---

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)