---
title: ToggleStyleConfiguration
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/togglestyleconfiguration
---

# ToggleStyleConfiguration

The properties of a toggle instance.

## Declaration

```swift
struct ToggleStyleConfiguration
```

## Overview

Overview When you define a custom toggle style by creating a type that conforms to the ToggleStyle protocol, you implement the makeBody(configuration:) method. That method takes a ToggleStyleConfiguration input that has the information you need to define the behavior and appearance of a Toggle. The configuration structure’s label reflects the toggle’s content, which might be the value that you supply to the label parameter of the init(isOn:label:) initializer. Alternatively, it could be another view that SwiftUI builds from an initializer that takes a string input, like init(_:isOn:). In either case, incorporate the label into the toggle’s view to help the user understand what the toggle does. For example, the built-in switch style horizontally stacks the label with the control element. The structure’s isOn property provides a Binding to the state of the toggle. Adjust the appearance of the toggle based on this value. For example, the built-in button style fills the button’s background when the property is true, but leaves the background empty when the property is false. Change the value when the user performs an action that’s meant to change the toggle, like the button does when tapped or clicked by the user.

## Topics

### Getting the label view

- [label](swiftui/togglestyleconfiguration/label-swift.property.md)
- [ToggleStyleConfiguration.Label](swiftui/togglestyleconfiguration/label-swift.struct.md)

### Managing the toggle state

- [isMixed](swiftui/togglestyleconfiguration/ismixed.md)
- [isOn](swiftui/togglestyleconfiguration/ison.md)
- [$isOn](swiftui/togglestyleconfiguration/$ison.md)

## See Also

### Styling toggles

- [toggleStyle(_:)](swiftui/view/togglestyle(_:).md)
- [ToggleStyle](swiftui/togglestyle.md)
