<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ToggleStyleConfiguration/isOn",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI24ToggleStyleConfigurationV4isOnSbvp"
  },
  "title" : "isOn"
}
-->

# isOn

A binding to a state property that indicates whether the toggle is on.

```
@Binding var isOn: Bool { get nonmutating set }
```

## Discussion

Because this value is a [`Binding`](/documentation/SwiftUI/Binding), you can both read and write it
in your implementation of the [`makeBody(configuration:)`](/documentation/SwiftUI/ToggleStyle/makeBody(configuration:))
method when defining a custom [`ToggleStyle`](/documentation/SwiftUI/ToggleStyle). Access it through
that method’s `configuration` parameter.

Read this value to set the appearance of the toggle. For example, you
can choose between empty and filled circles based on the `isOn` value:

```
Image(systemName: configuration.isOn
    ? "checkmark.circle.fill"
    : "circle")
```

Write this value when the user takes an action that’s meant to change
the state of the toggle. For example, you can toggle it inside the
`action` closure of a [`Button`](/documentation/SwiftUI/Button) instance:

```
Button {
    configuration.isOn.toggle()
} label: {
    // Draw the toggle.
}
```

---

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)