<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/WindowVisibilityToggle/init(windowID:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI22WindowVisibilityToggleV8windowIDACyAA07DefaultcdE5LabelVGSS_tcAFRszrlufc"
  },
  "title" : "init(windowID:)"
}
-->

# init(windowID:)

Create a window visibility toggle to alter the visibility of a specific
window.

```
nonisolated init(windowID: String) where Label == DefaultWindowVisibilityToggleLabel
```

## Parameters

`windowID`

The `id` of the singleton window type that
should be toggled. If this is not a valid id, the toggle will be
disabled and non-functional.

---

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)