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
Context Menu Preview - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Context Menu Preview

A context menu with custom preview

Photos Picker Title - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Photos Picker Title

Overrides the title of the Photos picker. The title is not visible on small screens, like the iPhone.

Tab View Side Bar Header - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Tab View Side Bar Header

Adds a custom header to the sidebar of a tab view.

Glass Effect Container - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Glass Effect Container

A view that combines multiple Liquid Glass shapes into a single shape that can morph individual shapes into one another

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

LinearProgressViewStyle

A progress view that visually indicates its progress using a horizontal bar

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

Divider Height

Customizing the height of the Divider

RadioGroupPickerStyle - macOS - Liquid Glass - Light Mode - Preview
style

RadioGroupPickerStyle

A picker style that presents the options as a group of radio buttons.

Bottom Accessory - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Bottom Accessory

A modifier to place content above the tabs