Contents

ButtonStyle

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

Declaration

@MainActor @preconcurrency protocol ButtonStyle

Overview

To configure the current button style for a view hierarchy, use the buttonStyle(_:) modifier. Specify a style that conforms to ButtonStyle when creating a button that uses the standard button interaction behavior defined for each platform. To create a button with custom interaction behavior, use PrimitiveButtonStyle instead.

Topics

Custom button styles

See Also

Styling buttons