Interactive previews iPhone

Multiple Sources Toggle

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

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

Platform Compatibility

iOS 16.0+ iPadOS 16.0+ macOS 13.0+ watchOS 9.0+ tvOS 16.0+ visionOS 1.0+

Tags

SwiftUI Code

Docs
struct Cat: Identifiable {
    let id = UUID()
    var name: String
    var isHungry: Bool
}

@State private var sources = [
    Cat(name: "Bella", isHungry: false),
    Cat(name: "Max", isHungry: true)
]

var body: some View {
    List {
        Toggle("Foo1", sources: $sources, isOn: \.isHungry)
        ForEach(sources) { pet in
            Text("\(pet.name): \(pet.isHungry ? "😾" : "😻")")
        }
    }
}

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.

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.

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
Standard Colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
type

Standard Colors

The SwiftUI standard colors

Materials - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
type

Materials

All materials

Scroll Gesture Axis Lock - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Scroll Gesture Axis Lock

Sets whether scrollable views within this view lock each scroll gesture to its predominant axis. On macOS, scroll gestures lock to their predominant axis by default. On iOS, iPadOS, Mac Catalyst, visionOS, and watchOS, scroll gestures move along both axes at once.

Custom Icon Product View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Custom Icon Product View

Creates a view to load an individual product from the App Store and merchandise it using a custom icon.

Sheet Placement - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
modifier

Sheet Placement

Sets the placement of a presentation within the presenting view. This may fall back to center on small screens.

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

PaletteControlGroupStyle

A control group style that presents its content as a palette.

Page Screen Sheet Size - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Page Screen Sheet Size

On devices smaller than a page of paper, such as iPhone, Apple Watch, and 8" or 11" iPads, the sheet fills the entire height and, unlike the default sheet on iPad, the full width. On macOS, .page behaves like .fitted.

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

NavigationSplitView

Creates a two-column navigation split view.