Contents

buttonStyle(_:)

Sets the style for buttons within this view to a button style with a custom appearance and custom interaction behavior.

Declaration

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

Discussion

Use this modifier to set a specific style for button instances within a view:

HStack {
    Button("Sign In", action: signIn)
    Button("Register", action: register)
}
.buttonStyle(.bordered)