Appearance
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
| Name | Type | Default | Description |
|---|---|---|---|
square | boolean | undefined | Square corners: removes the menu rounding (rounded by default). |
items | {
type?:
| "label"
| "item"
| "separator";
label?: string;
value?: string;
icon?: string;
disabled?: boolean;
danger?: boolean
}[] | undefined | Menu entries (alternative to the menu slot). |
modal | boolean | false | Modal 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-label | string | undefined | Accessible name of the menu (aria-label). |
flat | boolean | undefined | Removes the shadow. Overridden by the elevation prop when it is set. |
elevation | 0 | 1 | 2 | 3 | 4 | 5 | undefined | Shadow level 0–5 (scale); 0 means no shadow. Overrides flat. |
Events
| Name | Signature | Description |
|---|---|---|
select | (value: string) => void | A menu item was selected; receives the item's value. |
Slots
| Name | Description |
|---|---|
default | Area that opens the menu on right-click. |
menu | Custom menu content (instead of the items prop). |