---
title: "Multiple Sources Toggle | Explore SwiftUI"
description: "Creates a toggle that updates the selected property for all sources. Once toggled, all sources will have the same value"
canonical_url: "https://exploreswiftui.com/library/toggle/multiple-sources-toggle"
meta:
  author: "Explore SwiftUI"
  "og:description": "Creates a toggle that updates the selected property for all sources. Once toggled, all sources will have the same value"
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Multiple%2BSources%2BToggle%2Cdescription_~Q3JlYXRlcyBhIHRvZ2dsZSB0aGF0IHVwZGF0ZXMgdGhlIHNlbGVjdGVkIHByb3BlcnR5IGZvciBhbGwgc291cmNlcy4gT25jZSB0b2dnbGVkLCBhbGwgc291cmNlcyB3aWxsIGhhdmUgdGhlIHNhbWUgdmFsdWUu%2Ccategory_Toggle%2Cimage_~L2FwaS9pbWFnZXMvMjA5L3ZhcmlhbnRzLzYzMz92PTE3OTAwNzM0Nzg4NDImcj0yJnc9MTI4MCZxPTg1JmY9anBlZw%2CimageMode_crop%2CimagePosition_top%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm90dG9tOiAwOyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLXRvcC1sZWZ0LXJhZGl1czogNzRweDs%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidHZPUyIsInZpc2lvbk9TIl19%2Cp_Ii9saWJyYXJ5L3RvZ2dsZS9tdWx0aXBsZS1zb3VyY2VzLXRvZ2dsZSI%2Cs_0coJe02Stw_wqVDW.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Multiple Sources Toggle | Explore SwiftUI"
  "twitter:description": "Creates a toggle that updates the selected property for all sources. Once toggled, all sources will have the same value"
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Multiple%2BSources%2BToggle%2Cdescription_~Q3JlYXRlcyBhIHRvZ2dsZSB0aGF0IHVwZGF0ZXMgdGhlIHNlbGVjdGVkIHByb3BlcnR5IGZvciBhbGwgc291cmNlcy4gT25jZSB0b2dnbGVkLCBhbGwgc291cmNlcyB3aWxsIGhhdmUgdGhlIHNhbWUgdmFsdWUu%2Ccategory_Toggle%2Cimage_~L2FwaS9pbWFnZXMvMjA5L3ZhcmlhbnRzLzYzMz92PTE3OTAwNzM0Nzg4NDImcj0yJnc9MTI4MCZxPTg1JmY9anBlZw%2CimageMode_crop%2CimagePosition_top%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm90dG9tOiAwOyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLXRvcC1sZWZ0LXJhZGl1czogNzRweDs%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidHZPUyIsInZpc2lvbk9TIl19%2Cp_Ii9saWJyYXJ5L3RvZ2dsZS9tdWx0aXBsZS1zb3VyY2VzLXRvZ2dsZSI%2Cs_0coJe02Stw_wqVDW.png"
  "twitter:title": "Multiple Sources Toggle | Explore SwiftUI"
---

> Index of every page on this site: [llms.txt](https://exploreswiftui.com/llms.txt)

**Interactive previews**[ iPhone](https://exploreswiftui.com/iphone?element=209)

# **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](https://exploreswiftui.com/api/images/209/variants/633?v=1790073478842&r=2&w=800&q=80&f=webp)

### **Platform Compatibility**

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

### **Tags**

### **SwiftUI Code**

[ Docs](<https://developer.apple.com/documentation/swiftui/toggle/init(_:sources:ison:)>)

```
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 **](https://exploreswiftui.com/library/toggle)

![CheckboxToggleStyle - macOS - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/212/variants/622?v=1790073478842&r=2&w=412&q=75&f=webp)

### **CheckboxToggleStyle**

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

![SwitchToggleStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/211/variants/640?v=1790073478842&r=2&w=412&q=75&f=webp)

### **SwitchToggleStyle**

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

![ButtonToggleStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/210/variants/635?v=1790073478842&r=2&w=412&q=75&f=webp)

### **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](https://exploreswiftui.com/api/images/208/variants/624?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Toggle**

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

### **Explore Other Components **

[**Browse all **](https://exploreswiftui.com/)

![Overlay Arrangement Style - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/250/variants/1777?v=1790584733410&r=2&w=412&q=75&f=webp)

### **Overlay Arrangement Style**

An arrangement view style that layers the primary view over the secondary view in z-order.

![HelpLink - macOS - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/77/variants/30?v=1790073478842&r=2&w=412&q=75&f=webp)

### **HelpLink**

A button with a standard appearance that opens app-specific help documentation

![TextFieldLink - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/76/variants/192?v=1790073478842&r=2&w=412&q=75&f=webp)

### **TextFieldLink**

A control that requests text input from the user when pressed

![Glass effect - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/85/variants/2151?v=1794863893597&r=2&w=412&q=75&f=webp)

### **Glass effect**

Applies the Liquid Glass effect to a view

![Default Tab Bar Placement - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/239/variants/2069?v=1792681374978&r=2&w=412&q=75&f=webp)

### **Default Tab Bar Placement**

Specifies the preferred placement for the tabs of a TabView in the sidebarAdaptable style on platforms where the tab bar cannot adapt between different representations, and only one representation can be shown. For example, on iOS, it can enforce the sidebar on large-screen devices like the Pro Max, and iPhone Duo. This modifier has no effect on iPadOS.

![NavigationControlGroupStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/56/variants/404?v=1790073478842&r=2&w=412&q=75&f=webp)

### **NavigationControlGroupStyle**

The navigation control group style

![Link - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/73/variants/207?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Link**

A control for navigating to a URL

![Music Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/232/variants/727?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Music Picker**

Presents a music picker to select items from the Apple Music catalog and the user’s music library.

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://exploreswiftui.com/#website","@type":"WebSite","description":"A visual library for SwiftUI APIs, components, and modifiers","inLanguage":"en-US","name":"Explore SwiftUI","url":"https://exploreswiftui.com/","publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/toggle/multiple-sources-toggle#webpage","@type":"WebPage","dateModified":"2026-07-05T15:10:13.331Z","datePublished":"2026-07-05T15:09:49.627Z","description":"Creates a toggle that updates the selected property for all sources. Once toggled, all sources will have the same value","name":"Multiple Sources Toggle","url":"https://exploreswiftui.com/library/toggle/multiple-sources-toggle","breadcrumb":{"@id":"https://exploreswiftui.com/library/toggle/multiple-sources-toggle#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"mainEntity":{"@id":"https://exploreswiftui.com/library/toggle/multiple-sources-toggle#article"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/toggle/multiple-sources-toggle"]}],"primaryImageOfPage":{"@id":"https://exploreswiftui.com/#logo"}},{"@id":"https://exploreswiftui.com/#identity","@type":"Organization","description":"A visual library for SwiftUI APIs, components, and modifiers","name":"Explore SwiftUI","url":"https://exploreswiftui.com","logo":{"@id":"https://exploreswiftui.com/#logo"},"sameAs":["https://x.com/Typ0genius","https://mastodon.social/@Typ0genius"]},{"@id":"https://exploreswiftui.com/library/toggle/multiple-sources-toggle#article","citation":"https://developer.apple.com/documentation/swiftui/toggle/init(_:sources:ison:)","dateModified":"2026-07-05T15:10:13.331Z","datePublished":"2026-07-05T15:09:49.627Z","description":"Creates a toggle that updates the selected property for all sources. Once toggled, all sources will have the same value","headline":"Multiple Sources Toggle","inLanguage":"en-US","name":"Multiple Sources Toggle","thumbnailUrl":"https://exploreswiftui.com/api/images/209/variants/633?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/toggle/multiple-sources-toggle","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"hasPart":{"@id":"https://exploreswiftui.com/library/toggle/multiple-sources-toggle#source-code"},"image":{"@id":"https://exploreswiftui.com/#/schema/image/1"},"isPartOf":{"@id":"https://exploreswiftui.com/library/toggle/multiple-sources-toggle#webpage"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/toggle/multiple-sources-toggle#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/toggle/multiple-sources-toggle#source-code","@type":"SoftwareSourceCode","codeSampleType":"full example","description":"Creates a toggle that updates the selected property for all sources. Once toggled, all sources will have the same value","name":"Multiple Sources Toggle SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"struct Cat: Identifiable {\n    let id = UUID()\n    var name: String\n    var isHungry: Bool\n}\n\n@State private var sources = [\n    Cat(name: \"Bella\", isHungry: false),\n    Cat(name: \"Max\", isHungry: true)\n]\n\nvar body: some View {\n    List {\n        Toggle(\"Foo1\", sources: $sources, isOn: \\.isHungry)\n        ForEach(sources) { pet in\n            Text(\"\\(pet.name): \\(pet.isHungry ? \"😾\" : \"😻\")\")\n        }\n    }\n}","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"Toggle"},{"@type":"Thing","name":"Multiple Sources Toggle"}]},{"@id":"https://exploreswiftui.com/library/toggle/multiple-sources-toggle#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"Toggle","item":"https://exploreswiftui.com/library/toggle","position":2},{"@type":"ListItem","name":"Multiple Sources Toggle","item":"https://exploreswiftui.com/library/toggle/multiple-sources-toggle","position":3}]},{"@id":"https://exploreswiftui.com/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"},{"@id":"https://exploreswiftui.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://exploreswiftui.com/api/images/209/variants/633?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/209/variants/633?v=1790073478842&r=2"}]}
```