<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/PrimitiveButtonStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI20PrimitiveButtonStyleP"
  },
  "title" : "PrimitiveButtonStyle"
}
-->

# PrimitiveButtonStyle

A type that applies custom interaction behavior and a custom appearance to
all buttons within a view hierarchy.

```
@MainActor @preconcurrency protocol PrimitiveButtonStyle
```

## Overview

To configure the current button style for a view hierarchy, use the
[`buttonStyle(_:)`](/documentation/SwiftUI/View/buttonStyle(_:)) modifier. Specify a style that conforms to
`PrimitiveButtonStyle` to create a button with custom interaction
behavior. To create a button with the standard button interaction behavior
defined for each platform, use [`ButtonStyle`](/documentation/SwiftUI/ButtonStyle) instead.

A type conforming to this protocol inherits `@preconcurrency @MainActor`
isolation from the protocol if the conformance is included in the type’s
base declaration:

```
struct MyCustomType: Transition {
    // `@preconcurrency @MainActor` isolation by default
}
```

Isolation to the main actor is the default, but it’s not required. Declare
the conformance in an extension to opt out of main actor isolation:

```
extension MyCustomType: Transition {
    // `nonisolated` by default
}
```

## Topics

### Getting built-in button styles

[`automatic`](/documentation/SwiftUI/PrimitiveButtonStyle/automatic)

The default button style, based on the button’s context.

[`accessoryBar`](/documentation/SwiftUI/PrimitiveButtonStyle/accessoryBar)

A button style that is typically used in the context of an accessory
toolbar (sometimes refererred to as a “scope bar”), for buttons that
narrow the focus of a search or other operation.

[`accessoryBarAction`](/documentation/SwiftUI/PrimitiveButtonStyle/accessoryBarAction)

A button style that you use for extra actions in an accessory toolbar.

[`bordered`](/documentation/SwiftUI/PrimitiveButtonStyle/bordered)

A button style that applies the standard border style based on the button’s context.

[`borderedProminent`](/documentation/SwiftUI/PrimitiveButtonStyle/borderedProminent)

A button style that applies the standard bordered prominent style based on the button’s context.

[`borderless`](/documentation/SwiftUI/PrimitiveButtonStyle/borderless)

A button style that doesn’t apply a border.

[`card`](/documentation/SwiftUI/PrimitiveButtonStyle/card)

A button style that doesn’t pad the content, and applies a Liquid Glass effect when the button has focus.

[`glass`](/documentation/SwiftUI/PrimitiveButtonStyle/glass)

A button style that applies a Liquid Glass effect based on the
button’s context.

[`glassProminent`](/documentation/SwiftUI/PrimitiveButtonStyle/glassProminent)

A button style that applies a prominent Liquid Glass effect based on the
button’s context.

[`glass(_:)`](/documentation/SwiftUI/PrimitiveButtonStyle/glass(_:))

A button style that applies a configurable Liquid Glass effect based on the button’s context.

[`link`](/documentation/SwiftUI/PrimitiveButtonStyle/link)

A button style for buttons that emulate links.

[`plain`](/documentation/SwiftUI/PrimitiveButtonStyle/plain)

A button style that doesn’t style or decorate its content while idle,
but may apply a visual effect to indicate the pressed, focused, or
enabled state of the button.

### Creating custom button styles

[`makeBody(configuration:)`](/documentation/SwiftUI/PrimitiveButtonStyle/makeBody(configuration:))

Creates a view that represents the body of a button.

[`PrimitiveButtonStyle.Configuration`](/documentation/SwiftUI/PrimitiveButtonStyle/Configuration)

The properties of a button.

[`Body`](/documentation/SwiftUI/PrimitiveButtonStyle/Body)

A view that represents the body of a button.

### Supporting types

[`DefaultButtonStyle`](/documentation/SwiftUI/DefaultButtonStyle)

The default button style, based on the button’s context.

[`AccessoryBarButtonStyle`](/documentation/SwiftUI/AccessoryBarButtonStyle)

A button style that you use for actions in an accessory toolbar that
narrow the focus of a search or other operation.

[`AccessoryBarActionButtonStyle`](/documentation/SwiftUI/AccessoryBarActionButtonStyle)

A button style that you use for extra actions in an accessory toolbar.

[`BorderedButtonStyle`](/documentation/SwiftUI/BorderedButtonStyle)

A button style that applies standard border artwork based on the button’s
context.

[`BorderedProminentButtonStyle`](/documentation/SwiftUI/BorderedProminentButtonStyle)

A button style that applies standard border prominent artwork based
on the button’s context.

[`BorderlessButtonStyle`](/documentation/SwiftUI/BorderlessButtonStyle)

A button style that doesn’t apply a border.

[`CardButtonStyle`](/documentation/SwiftUI/CardButtonStyle)

A button style that doesn’t pad the content, and applies a motion effect
when a button has focus.

[`LinkButtonStyle`](/documentation/SwiftUI/LinkButtonStyle)

A button style for buttons that emulate links.

[`PlainButtonStyle`](/documentation/SwiftUI/PlainButtonStyle)

A button style that doesn’t style or decorate its content while idle, but
may apply a visual effect to indicate the pressed, focused, or enabled state
of the button.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)