---
title: "Toggle Components | Explore SwiftUI"
description: "A control that toggles between on and off states. Explore 5 SwiftUI toggle components with code examples for iOS, macOS, watchOS, tvOS, and visionOS."
canonical_url: "https://exploreswiftui.com/library/toggle"
meta:
  author: "Explore SwiftUI"
  "og:description": "A control that toggles between on and off states. Explore 5 SwiftUI toggle components with code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "og:image": "https://exploreswiftui.com/_og/d/c_Default%2Ctitle_Toggle%2BComponents%2Cdescription_Explore%2B5%2BSwiftUI%2Bcomponents%2Bvisually%2Cp_Ii9saWJyYXJ5L3RvZ2dsZSI%2Cs_aJDMr0k_aWx04fKp.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Toggle Components | Explore SwiftUI"
  "twitter:description": "A control that toggles between on and off states. Explore 5 SwiftUI toggle components with code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Default%2Ctitle_Toggle%2BComponents%2Cdescription_Explore%2B5%2BSwiftUI%2Bcomponents%2Bvisually%2Cp_Ii9saWJyYXJ5L3RvZ2dsZSI%2Cs_aJDMr0k_aWx04fKp.png"
  "twitter:title": "Toggle Components | Explore SwiftUI"
---

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

# **Toggle Components**

A control that toggles between on and off states.

5 components

![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=412&q=75&f=webp)

### **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](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.

![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.

```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#webpage","description":"A control that toggles between on and off states. Explore 5 SwiftUI toggle components with code examples for iOS, macOS, watchOS, tvOS, and visionOS.","inLanguage":"en-US","name":"Toggle Components","url":"https://exploreswiftui.com/library/toggle","@type":["WebPage","CollectionPage"],"about":{"@id":"https://developer.apple.com/documentation/swiftui"},"breadcrumb":{"@id":"https://exploreswiftui.com/library/toggle#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"mainEntity":{"@id":"https://exploreswiftui.com/library/toggle#itemlist"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/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#itemlist","@type":"ItemList","name":"Toggle Components","numberOfItems":5,"itemListElement":[{"@type":"ListItem","position":1,"name":"Multiple Sources Toggle","url":"https://exploreswiftui.com/library/toggle/multiple-sources-toggle"},{"@type":"ListItem","position":2,"name":"Toggle","url":"https://exploreswiftui.com/library/toggle/toggle"},{"@type":"ListItem","position":3,"name":"CheckboxToggleStyle","url":"https://exploreswiftui.com/library/toggle/checkboxtogglestyle"},{"@type":"ListItem","position":4,"name":"SwitchToggleStyle","url":"https://exploreswiftui.com/library/toggle/switchtogglestyle"},{"@type":"ListItem","position":5,"name":"ButtonToggleStyle","url":"https://exploreswiftui.com/library/toggle/buttontogglestyle"}]},{"@id":"https://exploreswiftui.com/library/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}]},{"@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"}]}
```