SwitchToggleStyle

A toggle style that displays a leading label and a trailing switch.

SwitchToggleStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Platform Compatibility

iOS 13.0+ iPadOS 13.0+ macOS 10.15+ watchOS 6.0+ tvOS 18.0+ visionOS 1.0+

Tags

SwiftUI Code

Docs
@State var isOn = false

var body: some View {
    List {
        Toggle("Foo1", isOn: $isOn)
        Toggle("Foo2", image: .cats24X24, isOn: $isOn)
        Toggle("Foo3", systemImage: "star", isOn: $isOn)
        Toggle(isOn: $isOn) {
            Label("Foo4", systemImage: "star")
            Text("Bar")
        }
        Toggle("Foo5", isOn: .constant(true))
    }
    .toggleStyle(.switch)
}

Found an issue or have a suggestion?

Created: July 5, 2026Updated: July 5, 2026

More Toggle Components

View all
CheckboxToggleStyle - macOS - Liquid Glass - Light Mode - Preview
style

CheckboxToggleStyle

A toggle style that displays a checkbox followed by its label.

ButtonToggleStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

ButtonToggleStyle

A toggle style that displays as a button with its label as the title.

Multiple Sources Toggle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Multiple Sources Toggle

Creates a toggle that updates the selected property for all sources. Once toggled, all sources will have the same value.

Toggle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Toggle

Creates a toggle with title, image, systemImage, and custom label.

Explore Other Components

Browse all
Overlay Arrangement ZIndex - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
environment

Overlay Arrangement ZIndex

The z-index for a view within an overlay arrangement view.

BorderedListStyle - macOS - Flat Design - Light Mode - Preview
style

BorderedListStyle

The list style that describes the behavior and appearance of a list with standard border.

Button Sizing - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Button Sizing

The preferred sizing behavior of buttons in the view hierarchy.

UIKit Text Colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
type

UIKit Text Colors

The UIKit text colors that are also used in other components, such as the TextField

DatePicker Components  - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

DatePicker Components

A date picker with only one displayed component

InlinePickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

InlinePickerStyle

A PickerStyle where each option is displayed inline with other views in the current container.

Menu Divider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
content

Menu Divider

A Menu with a Divider

InsetGroupedListStyle - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
style

InsetGroupedListStyle

The list style that describes the behavior and appearance of an inset grouped list.