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

# init(_:id:content:)

Creates a window with a localized title and an identifier.

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

## Parameters

`titleResource`

A localized string resource to use for the window’s
title in system menus and in the window’s title bar. Provide a title
that describes the purpose of the window.

`id`

A unique string identifier that you can use to
open the window.

`content`

The view content to display in the window.

## Discussion

The window displays the view that you specify.

---

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)