Interactive previews iPhone

Context Menu

Adds a context menu to a view.

Context Menu - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Platform Compatibility

iOS 13.0+ iPadOS 13.0+ macOS 10.15+ tvOS 14.0+ visionOS 1.0+

Tags

SwiftUI Code

Docs
Text("Buttons")
    .contextMenu {
        Button("Button 1", action: action)
        Button("Button 2", systemImage: "button.vertical.left.press", action: action)
        Button(action: action) {
            Text("Button 3")
            Text("Description 3")
        }
    }

Found an issue or have a suggestion?

Created: May 30, 2025Updated: December 27, 2025
Connect Wizard

Connect Wizard

Unlock insights App Store Connect doesn’t show you.

Get Started

More Menu Components

View all
Context Menu Preview - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Context Menu Preview

A context menu with custom preview

Menu Action Button - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Menu Action Button

Acts like a button and opens the menu on a secondary gesture

Nested Menu - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
content

Nested Menu

A Menu inside a Menu

Menu Divider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
content

Menu Divider

A Menu with a Divider

Menu Section - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
content

Menu Section

A Section inside a Menu

Menu Fixed Order - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Menu Fixed Order

Order items from top to bottom

Menu - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Menu

A control for presenting a menu of actions.

Explore Other Components

Browse all
Item Alert - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Item Alert

Presents an alert using the given data to produce the alert’s content and a text view as a title.

ToolbarItem Shared Background Visibility - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

ToolbarItem Shared Background Visibility

Controls the visibility of the glass background effect on items in the toolbar. In certain contexts, such as the navigation bar on iOS and the window toolbar on macOS, toolbar items will be given a glass background effect that is shared with other items in the same logical grouping

ProgressView - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

ProgressView

The different ProgressView initializers

Future DatePicker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Future DatePicker

Creates an instance that selects multiple dates on or after some start date

SegmentedPickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

SegmentedPickerStyle

A picker style that presents the options in a segmented control. Use this style when there are two to five options. Consider using menu when there are more than five options.

Button Sizing - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Button Sizing

The preferred sizing behavior of buttons in the view hierarchy.

Button Roles - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Button Roles

A value that describes the purpose of a button.

Picker Divider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
content

Picker Divider

A Picker with a Divider