Contents

ControlGroup

A container view that displays semantically-related controls in a visually-appropriate manner for the context

Declaration

struct ControlGroup<Content> where Content : View

Mentioned in

Overview

You can provide an optional label to this view that describes its children. This view may be used in different ways depending on the surrounding context. For example, when you place the control group in a toolbar item, SwiftUI uses the label when the group is moved to the toolbar’s overflow menu.

ContentView()
    .toolbar(id: "items") {
        ToolbarItem(id: "media") {
            ControlGroup {
                MediaButton()
                ChartButton()
                GraphButton()
            } label: {
                Label("Plus", systemImage: "plus")
            }
        }
    }

Topics

Creating a control group

Creating a control group with an image

Creating a configured control group

Supporting types

See Also

Presenting a group of controls