Context Menu
Native Solid 2 fork. Original documentation and designs © WorkOS; historical posts retain their original context.
API Reference
This component inherits props from the Context Menu primitive.
Root
Contains all the parts of a context menu.
Trigger
Wraps the element that will open the context menu.
Content
The component that pops out when the context menu is open.
Label
Used to render a label. It won't be focusable using arrow keys.
Item
The component that contains the context menu items.
Group
Used to group multiple Item parts.
RadioGroup
Used to group multiple RadioItem parts.
RadioItem
An item that can be controlled and rendered like a radio.
CheckboxItem
An item that can be controlled and rendered like a checkbox.
Sub
Contains all the parts of a submenu.
SubTrigger
An item that opens a submenu. Must be rendered inside ContextMenu.Sub.
SubContent
The component that pops out when a submenu is open. Must be rendered inside ContextMenu.Sub.
Examples
Size
Use the size prop to control the size.
Variant
Use the variant prop to customize the visual style of the context menu.
Color
Use the color prop to assign a specific color. You can also pass color to a specific item to override for semantic reasons (i.e. a destructive action).
High-contrast
Use the highContrast prop to increase color contrast with the background.