🅿️PrimitiveButtonStyle
SwiftUI ⟩ Controls ⟩ Button ⟩ Styles ⟩ PrimitiveButtonStyle

// ⭐️ 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)SwiftUI ⟩ Controls ⟩ Button ⟩
ButtonStyle (protocol) - standard button interaction behavior.
PrimitiveButtonStyle (protocol) - custom interaction behavior & appearance.
.automatic, .bordered, .borderedProminent, .borderless, .plain
.card (tvOS 14), .link (macOS 10.15)
Last updated
Was this helpful?