Interactive previews iPhone Apple Watch

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

Platform Compatibility

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

Tags

SwiftUI Code

Docs
@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

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.

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

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
initializer

Toggle

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

Explore Other Components

Browse all
Hidden List Row Separator - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
modifier

Hidden List Row Separator

Sets the display mode to hidden for the separator associated with this specific row.

Content Unavailable Search Text - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
type

Content Unavailable Search Text

A pre-built placeholder for empty search results with search text

Context Menu - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Context Menu

Adds a context menu to a view.

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.

Message Item Alert - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Message Item Alert

Presents an alert with a message using the given data to produce the alert’s content and a localized string key for a title.

Glass effect - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Glass effect

Applies the Liquid Glass effect to a view

Toolbar Title Alignment - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Toolbar Title Alignment

Sets the preferred alignment of the navigation bar’s title. The navigation bar resolves the alignment of its title automatically based on context, and toolbar roles. Use this modifier to override that resolution.

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

PageTabViewStyle

A TabViewStyle that displays a paged scrolling TabView.