---
title: "buttonStyle(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/buttonstyle(_:)-66fbx"
---

# buttonStyle(_:)

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

## Declaration

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

```

## Discussion

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)
