<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/MenuStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI9MenuStyleP"
  },
  "title" : "MenuStyle"
}
-->

# MenuStyle

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

```
@MainActor @preconcurrency protocol MenuStyle
```

## Overview

To configure the current menu style for a view hierarchy, use the
[`menuStyle(_:)`](/documentation/SwiftUI/View/menuStyle(_:)) modifier.

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 menu styles

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

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

[`button`](/documentation/SwiftUI/MenuStyle/button)

A menu style that displays a button that toggles the display of
the menu’s contents when pressed.

[`borderedButton`](/documentation/SwiftUI/MenuStyle/borderedButton)

A menu style that displays a bordered button that toggles the display of
the menu’s contents when pressed.

[`borderlessButton`](/documentation/SwiftUI/MenuStyle/borderlessButton)

A menu style that displays a borderless button that toggles the display of
the menu’s contents when pressed.

### Creating custom menu styles

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

Creates a view that represents the body of a menu.

[`Configuration`](/documentation/SwiftUI/MenuStyle/Configuration)

The properties of a menu.

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

A view that represents the body of a menu.

### Supporting types

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

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

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

A menu style that displays a button that toggles the display of the
menu’s contents when pressed.

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

A menu style that displays a borderless button that toggles the display of
the menu’s contents when pressed.

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

A menu style that displays a bordered button that toggles the display of the
menu’s contents when pressed.

## Relationships

### Conforming Types

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

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

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

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

---

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)