Compose SwiftUIv0.4.0
esc
GuideAPIGitHub
View modifier

buttonStyle(_:)

Sets the style of the buttons in a view.

iOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+
fun Modifier.buttonStyle(style: PrimitiveButtonStyle): Modifier

Overview

Button("Continue", action = vm::next, modifier = Modifier.buttonStyle(PrimitiveButtonStyle.borderedProminent))

This is the Kotlin form of SwiftUI View.buttonStyle(_:): SwiftUI documentation. In Swift it reads:

nonisolated func buttonStyle<S>(_ style: S) -> some View where S : PrimitiveButtonStyle

Topics

Overloads

fun Modifier.buttonStyle(style: PrimitiveButtonStyle): Modifier
SwiftUI View.buttonStyle(_:)