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: May 30, 2025