Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Overlays

ContextMenu <pm-context-menu>

Context menu: right-click (or long-press, Shift+F10, the Menu key) inside this element opens the pm-menu referenced by menu at the pointer. The region itself stays fully interactive.

Full screen
Right-click, long-press or Shift+F10 here

This component has no props to try here.

<script type="module"> import '@prismora/css'; import '@prismora/elements/context-menu'; import '@prismora/elements/menu'; </script> <pm-context-menu menu="demo-ctx"> <div tabindex="0" style="display:grid;place-items:center;inline-size:min(100%,22rem);block-size:9rem;border:2px dashed var(--pm-color-border-strong);border-radius:var(--pm-radius-lg);color:var(--pm-color-fg-muted)">Right-click, long-press or Shift+F10 here</div> </pm-context-menu> <pm-menu id="demo-ctx"> <button role="menuitem">Open</button> <button role="menuitem">Rename</button> <button role="menuitem">Copy link</button> <hr> <button role="menuitem" data-tone="danger">Move to trash</button> </pm-menu>

States

Each state is one attribute.

Right-click, long-press or Shift+F10 here
Disabled

Attributes

AttributeTypeDefaultDescription
mobileboolean—Native mobile pattern on phones: opens as a swipeable bottom sheet (inherits from ancestors such as <html mobile>; mobile="false" opts out).
menustring—id of the pm-menu to open.
disabledboolean—Use the browser's own context menu instead.

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Events

EventReact / Svelte propDescription
pm-closeonPmCloseThe menu it opened closed.
pm-openonPmOpenThe menu opened.

Slots

SlotDescription
(default)The region that owns the menu.

Methods

openAt(), hide()