Interactive previews iPhone

Context Menu Preview

A context menu with custom preview

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

Platform Compatibility

iOS 16.0+ iPadOS 16.0+ macOS 13.0+ tvOS 16.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")
        }
    } preview: {
        Text("Custom Preview")
            .padding()
    }

Found an issue or have a suggestion?

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

More Menu Components

View all
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

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

Context Menu

Adds a context menu to a view.

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
Default Collapsed Tab Section - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Default Collapsed Tab Section

Sets the default expansion state for the section containing this tab to collapsed when displayed in the sidebar.

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

ButtonToggleStyle

A toggle style that displays as a button with its label as the title.

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

Toggle

Creates a toggle with title, image, systemImage, and custom label.

RadioGroupPickerStyle - macOS - Liquid Glass - Light Mode - Preview
style

RadioGroupPickerStyle

A picker style that presents the options as a group of radio buttons.

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

TabsPickerStyle

A picker style that presents options as segmented tabs. On macOS, this style produces a segmented picker with a visual treatment that distinguishes tab navigation from value selection. On iOS, tvOS, and visionOS, the visual appearance matches that of the standard standard .segmented style. On all supported platforms, VoiceOver announces options as tabs.

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

AccessoryLinearGaugeStyle

A gauge style that displays bar with a marker that appears at a point along the bar to indicate the gauge’s current value

RenameButton - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
TextField

RenameButton

A button that triggers a standard rename action

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

LinearProgressViewStyle

A progress view that visually indicates its progress using a horizontal bar