ButtonToggleStyle

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

StructureiOS 15.0+macOS 12.0+watchOS 9.0+ButtonToggleStyle in SwiftUI

Declaration

React
type ButtonToggleStyle = SwiftOpaque<'ButtonToggleStyle'>;
Swift
nonisolated struct ButtonToggleStyle

Overview

You can also use ToggleStyle.button to construct this style.

Toggle(isOn: $isFlagged) {
    Label("Flag", systemImage: "flag.fill")
}
.toggleStyle(.button)

From Apple’s SwiftUI documentation. Code samples there are Swift.

See also

More in Styles.