Contents

MenuStyleConfiguration

A configuration of a menu.

Declaration

struct MenuStyleConfiguration

Overview

Use the init(_:) initializer of Menu to create an instance using the current menu style, which you can modify to create a custom style.

For example, the following code creates a new, custom style that adds a red border to the current menu style:

struct RedBorderMenuStyle: MenuStyle {
    func makeBody(configuration: Configuration) -> some View {
        Menu(configuration)
            .border(Color.red)
    }
}

Topics

Setting the label and content

See Also

Styling menus