---
title: "init(_:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/menu/init(_:)"
---

# init(_:)

Creates a menu based on a style configuration.

## Declaration

```swift
nonisolated init(_ configuration: MenuStyleConfiguration)
```

## Discussion

Discussion Use this initializer within the makeBody(configuration:) method of a MenuStyle instance to create an instance of the menu being styled. This is useful for custom menu styles that modify the current menu style. For example, the following code creates a new, custom style that adds a red border around the current menu style: struct RedBorderMenuStyle: MenuStyle {     func makeBody(configuration: Configuration) -> some View {         Menu(configuration)             .border(Color.red)     } }
