# PrimitiveButtonStyle

[SwiftUI](../../..) ⟩ [Controls](../..) ⟩ [Button](..) ⟩ [Styles]() ⟩ PrimitiveButtonStyle

{% tabs %}
{% tab title="💈範例" %}
![](https://1830103165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5-JmwCZMKh_d7RfBaN%2Fuploads%2FEzex2VqZGXBHyplGNzrc%2Fbutton%20builtin%20styles.png?alt=media\&token=389662bf-edcc-45a8-a1cc-8b5bc7197446)

```swift
// ⭐️ tvOS 還有 .card，macOS 還有 .link
Button(".plain") { /* action */ }.buttonStyle(.plain)
Button(".borderless") {  }.buttonStyle(.borderless)    // iOS default
Button(".bordered") {  }.buttonStyle(.bordered)
Button(".borderedProminent") {  }.buttonStyle(.borderedProminent)
Button(".automatic") {  }.buttonStyle(.automatic)
```
{% endtab %}

{% tab title="📗 參考" %}
* [x] Sarun ⟩ [SwiftUI ButtonStyle](https://sarunw.com/posts/swiftui-buttonstyle/)
{% endtab %}

{% tab title="📘 手冊" %}
* SwiftUI ⟩ Controls ⟩ [Button](https://developer.apple.com/documentation/swiftui/button) ⟩
  * [.buttonStyle\<S: ButtonStyle>()](https://developer.apple.com/documentation/swiftui/view/buttonstyle\(_:\)-7qx1)
  * [.buttonStyle\<S: PrimitiveButtonStyle>(\_:)](https://developer.apple.com/documentation/swiftui/view/buttonstyle\(_:\)-66fbx)
  * [ButtonStyle](https://developer.apple.com/documentation/swiftui/buttonstyle) (<mark style="color:red;">**protocol**</mark>) - <mark style="color:orange;">**standard**</mark> button interaction behavior.
  * [PrimitiveButtonStyle](https://developer.apple.com/documentation/swiftui/primitivebuttonstyle) (<mark style="color:red;">**protocol**</mark>) - <mark style="color:orange;">**custom**</mark> interaction behavior & appearance.
    * .[automatic](https://developer.apple.com/documentation/swiftui/primitivebuttonstyle/automatic), .bordered, .borderedProminent, .borderless, .plain
    * .card (tvOS 14), .link (macOS 10.15)
{% endtab %}

{% tab title="👥 相關" %}
* [viewmodifier](../../../view/modifier/viewmodifier "mention")
* [custom-styles](../../label/builtin-styles/custom-styles "mention")
{% endtab %}
{% endtabs %}
