---
title: "ButtonToggleStyle | Explore SwiftUI"
description: "A toggle style that displays as a button with its label as the title. Learn how to use ButtonToggleStyle in SwiftUI with visual code examples."
canonical_url: "https://exploreswiftui.com/library/toggle/buttontogglestyle"
meta:
  author: "Explore SwiftUI"
  "og:description": "A toggle style that displays as a button with its label as the title. Learn how to use ButtonToggleStyle in SwiftUI with visual code examples."
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_ButtonToggleStyle%2Cdescription_Explore%2Bvisually%2Bwith%2Bcode%2Bexamples%2Ccategory_Toggle%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidmlzaW9uT1MiXX0%2Cp_Ii9saWJyYXJ5L3RvZ2dsZS9idXR0b250b2dnbGVzdHlsZSI%2Cs_ZbwFXDF8POw2xtpr.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "ButtonToggleStyle | Explore SwiftUI"
  "twitter:description": "A toggle style that displays as a button with its label as the title. Learn how to use ButtonToggleStyle in SwiftUI with visual code examples."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_ButtonToggleStyle%2Cdescription_Explore%2Bvisually%2Bwith%2Bcode%2Bexamples%2Ccategory_Toggle%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidmlzaW9uT1MiXX0%2Cp_Ii9saWJyYXJ5L3RvZ2dsZS9idXR0b250b2dnbGVzdHlsZSI%2Cs_ZbwFXDF8POw2xtpr.png"
  "twitter:title": "ButtonToggleStyle | Explore SwiftUI"
---

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

**Interactive previews**[ iPhone](https://exploreswiftui.com/iphone?element=210) [ Apple Watch](https://exploreswiftui.com/watch?element=210)

# **ButtonToggleStyle**

A toggle style that displays as a button with its label as the title.

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

### **Platform Compatibility**

iOS 15.0+ iPadOS 15.0+ macOS 12.0+ watchOS 9.0+ visionOS 1.0+

### **Tags**

### **SwiftUI Code**

[ Docs](https://developer.apple.com/documentation/swiftui/buttontogglestyle)

```
@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))
    }
    .toggleStyle(.button)
}
```

### **Found an issue or have a suggestion?**

Created: July 5, 2026Updated: July 5, 2026

![Connect Wizard](https://exploreswiftui.com/_ipx/f_webp&q_80&s_48x48/images/connect-wizard-icon.png)

**Connect Wizard**

**Unlock insights App Store Connect doesn’t show you.**

[** Get Started **](https://apps.apple.com/app/apple-store/id6747314580?pt=121213751&ct=Explore%20SwiftUI%20Banner&mt=8)

```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/buttontogglestyle#webpage","@type":"WebPage","dateModified":"2026-07-05T15:19:25.642Z","datePublished":"2026-07-05T15:19:25.642Z","description":"A toggle style that displays as a button with its label as the title. Learn how to use ButtonToggleStyle in SwiftUI with visual code examples.","name":"ButtonToggleStyle","url":"https://exploreswiftui.com/library/toggle/buttontogglestyle","breadcrumb":{"@id":"https://exploreswiftui.com/library/toggle/buttontogglestyle#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/toggle/buttontogglestyle"]}],"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/buttontogglestyle#article","dateModified":"2026-07-05T15:19:25.642Z","datePublished":"2026-07-05T15:19:25.642Z","description":"A toggle style that displays as a button with its label as the title. Learn how to use ButtonToggleStyle in SwiftUI with visual code examples.","headline":"ButtonToggleStyle","inLanguage":"en-US","name":"ButtonToggleStyle","thumbnailUrl":"https://exploreswiftui.com/api/images/210/variants/635?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/toggle/buttontogglestyle","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"image":{"@id":"https://exploreswiftui.com/#/schema/image/1"},"isPartOf":{"@type":"WebSite","name":"Explore SwiftUI","url":"https://exploreswiftui.com"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/toggle/buttontogglestyle#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/toggle/buttontogglestyle#/schema/software-source-code/1","@type":"SoftwareSourceCode","codeRepository":"https://developer.apple.com/documentation/swiftui/buttontogglestyle","codeSampleType":"full example","description":"A toggle style that displays as a button with its label as the title. Learn how to use ButtonToggleStyle in SwiftUI with visual code examples.","name":"ButtonToggleStyle SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"@State var isOn = false\n\nvar body: some View {\n    List {\n        Toggle(\"Foo1\", isOn: $isOn)\n        Toggle(\"Foo2\", image: .cats24X24, isOn: $isOn)\n        Toggle(\"Foo3\", systemImage: \"star\", isOn: $isOn)\n        Toggle(isOn: $isOn) {\n            Label(\"Foo4\", systemImage: \"star\")\n            Text(\"Bar\")\n        }\n        Toggle(\"Foo5\", isOn: .constant(true))\n    }\n    .toggleStyle(.button)\n}","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"Toggle"},{"@type":"Thing","name":"ButtonToggleStyle"}]},{"@id":"https://exploreswiftui.com/library/toggle/buttontogglestyle#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":"ButtonToggleStyle","item":"https://exploreswiftui.com/library/toggle/buttontogglestyle","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/210/variants/635?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/210/variants/635?v=1790073478842&r=2"}]}
```