Skip to content

Context Menu

SContextMenu is an action menu opened by a right click (or a long press on touch devices) on the trigger area. It is built on Reka UI (portal, keyboard navigation, menu/menuitem roles). The entries come from the items prop (items, separators, group labels), leading icons are rendered with SIcon. Picking an item emits the select event.

Basic usage

Item icons

The item's icon field renders a leading icon with SIcon (a registry name or a raw path).

Custom menu

The menu slot fully replaces the menu content (instead of the items prop), for example to add a group label and custom actions with arbitrary markup.

API

Props

NameTypeDefaultDescription
squarebooleanundefinedSquare corners: removes the menu rounding (rounded by default).
items{ type?: | "label" | "item" | "separator"; label?: string; value?: string; icon?: string; disabled?: boolean; danger?: boolean }[]undefinedMenu entries (alternative to the menu slot).
modalbooleanfalseModal mode: blocks interaction with the background and enables a focus trap. false by default, so page scroll is not locked (otherwise the scrollbar disappears on open and the layout shifts).
aria-labelstringundefinedAccessible name of the menu (aria-label).
flatbooleanundefinedRemoves the shadow. Overridden by the elevation prop when it is set.
elevation0 | 1 | 2 | 3 | 4 | 5undefinedShadow level 0–5 (scale); 0 means no shadow. Overrides flat.

Events

NameSignatureDescription
select(value: string) => voidA menu item was selected; receives the item's value.

Slots

NameDescription
defaultArea that opens the menu on right-click.
menuCustom menu content (instead of the items prop).