Interactive previews iPhone
Context Menu Preview
A context menu with custom preview
Platform Compatibility
iOS 16.0+ iPadOS 16.0+ macOS 13.0+ tvOS 16.0+ visionOS 1.0+
Tags
SwiftUI Code
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 allExplore Other Components
Browse allLinearProgressViewStyle
A progress view that visually indicates its progress using a horizontal bar
Custom Slider Ticks
Creates a slider to select a value from a given range, subject to a step increment, which displays the provided labels and customizable ticks.
UIKit Separator Colors
The UIKit separator colors that are also used in other components, such as the TextField
Horizontal Radio Group Layout
Sets the style for radio group style pickers within this view to be horizontally positioned with the radio buttons inside the layout.
LinearCapacityGaugeStyle
A gauge style that displays a bar that fills from leading to trailing edges as the gauge’s current value increases
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