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
Default Min List Row Height - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
modifier

Default Min List Row Height

The default minimum height of rows in a list.

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

Link

A control for navigating to a URL

Divider Height - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Divider Height

Customizing the height of the Divider

Hard ScrollEdgeEffect - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Hard ScrollEdgeEffect

A scroll edge effect with a hard cutoff and dividing line

Toolbar Overflow Menu - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Toolbar Overflow Menu

The overflow menu of a toolbar. An overflow menu represents actions that are always placed in the toolbar’s overflow menu, regardless of the toolbar mode, platform, or customizability.

EditButton - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
type

EditButton

A button that toggles the edit mode environment value

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

SliderTickContentForEach

A type of slider content that creates content by iterating over a collection.

Slider Color - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Slider Color

Customizing the color of the slider