Toggle

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

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

Platform Compatibility

iOS 13.0+ iPadOS 13.0+ macOS 10.15+ watchOS 6.0+ tvOS 13.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))
    }
}

Found an issue or have a suggestion?

Created: July 5, 2026Updated: July 5, 2026
Connect Wizard

Connect Wizard

Unlock insights App Store Connect doesn’t show you.

Get Started

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.

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

SwitchToggleStyle

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

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.

Explore Other Components

Browse all
Background Extension Effect - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Background Extension Effect

Adds the background extension effect to the view. The view will be duplicated into mirrored copies which will be placed around the view on any edge with available safe area. Additionally, a blur effect will be applied on top to blur out the copies

Content Unavailable - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Content Unavailable

A placeholder for empty results with optional button

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

SidebarListStyle

The list style that describes the behavior and appearance of a sidebar list.

System Image Label - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

System Image Label

Creates a label with a system icon image and a title generated from a localized string.

ViewThatFits - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
initializer

ViewThatFits

A view that adapts to the available space by providing the first child view that fits.

List Row Insets - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
modifier

List Row Insets

Applies an inset to the rows in a list.

Store View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Store View

Creates a view to load and merchandise a collection of products from the App Store using product identifiers. Internally, ProductView is used, and therefore productViewStyle can also be applied here.

Prioritize Sheet Content Scrolling - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Prioritize Sheet Content Scrolling

Configures the behavior of swipe gestures on a presentation. PresentationContentInteraction.scrolls prioritizes scrolling the content over resizing the sheet.