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

# init()

Creates a checkbox toggle style.

```
nonisolated init()
```

## Discussion

Don’t call this initializer directly. Instead, use the
[`checkbox`](/documentation/SwiftUI/ToggleStyle/checkbox) static variable to create this style:

```
Toggle("Close windows when quitting an app", isOn: $doesClose)
    .toggleStyle(.checkbox)
```

---

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)