Skip to main content

ContextMenu

Displays a Swift UI ContextMenu

Official Docs

Preview​

button preview

Example Usage​

  <RNSwiftUI.ContextMenu optionalSubviews={
<RNSwiftUI.VStack>
<RNSwiftUI.ControlGroup>
<RNSwiftUI.Button key="up">
<RNSwiftUI.Image systemIconName="hand.thumbsup" />
</RNSwiftUI.Button>
<RNSwiftUI.Button key="down">
<RNSwiftUI.Image systemIconName="hand.thumbsdown" />
</RNSwiftUI.Button>
</RNSwiftUI.ControlGroup>
<RNSwiftUI.Button key="mark">
<RNSwiftUI.Label text="Bookmark" systemIconName="bookmark"/>
</RNSwiftUI.Button>
<RNSwiftUI.Button key="rename">
<RNSwiftUI.Label text="Rename" systemIconName="pencil.and.ellipsis.rectangle" />
</RNSwiftUI.Button>
</RNSwiftUI.VStack>
}>
<RNSwiftUI.Label text="Test Contexxt Menu" systemIconName="questionmark.app" />
</RNSwiftUI.ContextMenu>

Props​

nametyperequireddescription
childrenReact.ReactNode✓The RNSwiftUI view that should trigger the menu
optionalSubviewsReact.ReactNode✓The RNSwiftUI view that should be displayed inside of the menu

extends SwiftUIViewProperties