A wider screen, please

This page features interactive demos and side-by-side code samples that need at least 340 pixels of horizontal space. Please widen your browser window, or rotate your device, to continue.

Morpheus v0.1.0
v0.1.0

Context menu#

Component <neo-contextmenu> is a right-click menu built from the same <neo-menuitem> and <neo-submenu> rows as <neo-menu> . Mark the focusable element with data-neo-contextmenu-trigger; everything else inside becomes the menu panel. Opens via the keyboard context-menu key and Shift+F10 as well.

Default
Simple
Nested
Custom content
Deactivate Rename Duplicate
Delete
New state Toggle autoplay
Right-click this note
Open Rename Inbox Archive Atlas Morpheus
Delete
HTML CSS

The selected state's markup and its scoped CSS. The CSS is wrapped in <style>@scope { ... }</style> and applies to the preview only. Edits change the preview above, applied live while Sync is on, or when you click Patch or Replace. Patch morphs the preview; Replace swaps it outright.

Replace Patch

Signals

Datastar signals declared in the selected state's markup. Change a value to drive the preview, applied live while Sync is on, or when you click Patch.

Patch

Reference#

Attributes #

NameTypeDefaultDescription
openboolean reflected observedfalseOpen state. Usually controlled by the host after a right-click or keyboard context-menu invocation.
mode"auto" | "cascade" | "push" observed"auto"Nested submenu strategy. Matches neo-menu: cascade on roomy pointers, push on narrow or touch-first contexts.
screen-offsetCSS length observed8pxMinimum distance between the panel and viewport edge.
clamp-placementboolean observedfalseAllows the panel to re-anchor from the pointer when needed to remain visible.
min-fit-heightCSS length | "content" observed"content"Strict-placement flip threshold inherited by submenus.
min-fit-widthCSS length | "content" observed"content"Strict-placement flip threshold inherited by submenus.

Slots #

NameDescription
[data-neo-contextmenu-trigger]Required descendant (any depth, but not inside a nested <neo-menu> or <neo-contextmenu>) that receives the contextmenu and keyboard handlers. The first match wins.
<neo-menu>Exactly one required <neo-menu> child holding the rows. It supplies all menu behavior; the context menu only opens it at the pointer. Zero or multiple warn in the console.

Events #

NameDetailBubblesDescription
neo-contextmenu-opennoneyesFires when the menu opens.
neo-contextmenu-closenoneyesFires when the menu closes.
neo-menuitem-selectnoneyesBubbles from selected child rows with { value }.

Examples#

Simple#

A context menu wraps one trigger surface and a set of menu rows. The trigger stays in the page; the rows move into the generated floating panel.

Right-click this note
Open Rename Duplicate
Delete

Nested#

Context menus can be nested inside another trigger surface. Right-clicking the inner target opens its own menu without also opening the parent menu.

Workspace Right-click the blue workspace area.
Docs folder Right-click the green folder block.Preview file Copy path
Open folder Rename folder Duplicate folder
Share folder
New file New folder Sync workspace Workspace settings
Archive workspace

Custom content#

The trigger is regular light DOM and the panel uses the same menu CSS variables, so custom target surfaces, icon rows, widths, and danger treatments can be handled with a scoped stylesheet.

invoice-042.pdf Right-click for file actions
Copy link Copy filename
Delete

Settings

Theme

Default Sunshine Ocean Matrix Rose

Accessibility

Playgrounds

Server Simulator