automatic
The default menu style, based on the menu’s context.
Declaration
@MainActor @preconcurrency static var automatic: DefaultMenuStyle { get }Discussion
The default menu style can vary by platform. By default, macOS uses the bordered button style.
If you create a menu inside a container, the style resolves to the recommended style for menus inside that container for that specific platform. For example, a menu nested within another menu will resolve to a submenu:
Menu("Edit") {
Menu("Arrange") {
Button("Bring to Front", action: moveSelectionToFront)
Button("Send to Back", action: moveSelectionToBack)
}
Button("Delete", action: deleteSelection)
}You can override a menu’s style. To apply the default style to a menu, or to a view that contains a menu, use the menuStyle(_:) modifier.