// Generated by scripts/generate-showcase.mjs. Do not edit directly.
page ContextMenuDetail {
  layout = "showcase"
  state playground_items = JSON.parse(ctx.url.searchParams.get("pg_items") ?? "[{\"label\":\"Open dashboard\",\"description\":\"View the operational workspace\",\"value\":\"dashboard\",\"icon\":\"icon-[lucide--layout-dashboard]\"},{\"label\":\"Share record\",\"value\":\"share\",\"icon\":\"icon-[lucide--share-2]\",\"shortcut\":\"Ctrl S\"},{\"type\":\"divider\"},{\"label\":\"Delete record\",\"value\":\"delete\",\"icon\":\"icon-[lucide--trash-2]\",\"danger\":true}]")
  state playground_open = (ctx.url.searchParams.get("pg_open") ?? "false") === "true"
  state playground_defaultOpen = (ctx.url.searchParams.get("pg_defaultOpen") ?? "false") === "true"
  state playground_trigger = ctx.url.searchParams.get("pg_trigger") ?? "click"
  state playground_placement = ctx.url.searchParams.get("pg_placement") ?? "pointer"
  state playground_align = ctx.url.searchParams.get("pg_align") ?? "start"
  state playground_size = ctx.url.searchParams.get("pg_size") ?? "default"
  state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary"
  state playground_variant = ctx.url.searchParams.get("pg_variant") ?? "raised"
  state playground_title = ctx.url.searchParams.get("pg_title") ?? "Context Menu example"
  state playground_description = ctx.url.searchParams.get("pg_description") ?? "A polished default context menu for a modern application."
  state playground_label = ctx.url.searchParams.get("pg_label") ?? "Context Menu"
  state playground_closeOnSelect = (ctx.url.searchParams.get("pg_closeOnSelect") ?? "true") === "true"
  state playground_closeOnOutside = (ctx.url.searchParams.get("pg_closeOnOutside") ?? "true") === "true"
  state playground_disabled = (ctx.url.searchParams.get("pg_disabled") ?? "false") === "true"
  state playground_minWidth = ctx.url.searchParams.get("pg_minWidth") ?? "14rem"
  state playground_maxWidth = ctx.url.searchParams.get("pg_maxWidth") ?? "20rem"
  state playground_class = ctx.url.searchParams.get("pg_class") ?? "showcase-instance showcase-instance--1"
  seo {
    title = "Context Menu"
    description = "Open an accessible keyboard-aware action menu from pointer or keyboard context interactions."
  }
  view {
    <nav class="docs-breadcrumbs" aria-label="Breadcrumb">
      <a href="/">Components</a><span aria-hidden="true">/</span><a href="/overlays">Overlays</a><span aria-hidden="true">/</span><span>Context Menu</span>
    </nav>
    <header class="detail-hero">
      <div class="detail-hero-copy">
        <span class="showcase-eyebrow">Overlays component</span>
        <h1>Context Menu</h1>
        <p>Open an accessible keyboard-aware action menu from pointer or keyboard context interactions.</p>
        <div class="detail-badges"><span>18 props</span><span>4 slots</span><span>4 outputs</span><span>Theme ready</span><span>Responsive</span></div>
      </div>
      <div class="detail-hero-icon"><span class="icon-[lucide--component] size-10" aria-hidden="true"></span></div>
    </header>
    <section id="playground" class="detail-section playground-section" data-playground data-playground-component="ContextMenu" data-playground-public-tag="true" data-playground-has-slot="true" data-playground-events="open,close,select,action">
      <div class="detail-section-heading"><span>Interactive playground</span><h2>Configure Context Menu</h2><p>Change any prop and inspect the server-rendered component immediately.</p></div>
      <div class="playground-workbench">
        <div class="playground-preview">
          <div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
          <div class="playground-preview-source" data-playground-preview><ContextMenu items='{playground_items}' open='{playground_open}' defaultOpen='{playground_defaultOpen}' trigger='{playground_trigger}' placement='{playground_placement}' align='{playground_align}' size='{playground_size}' color='{playground_color}' variant='{playground_variant}' title='{playground_title}' description='{playground_description}' label='{playground_label}' closeOnSelect='{playground_closeOnSelect}' closeOnOutside='{playground_closeOnOutside}' disabled='{playground_disabled}' minWidth='{playground_minWidth}' maxWidth='{playground_maxWidth}' class='{playground_class}'><div data-slot="trigger"><div class="showcase-context-target">Right-click for contextual actions</div></div></ContextMenu></div>
          <section class="playground-code" aria-label="Current component code">
            <header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component code</span><button type="button" data-playground-copy><span class="icon-[lucide--copy] size-4" aria-hidden="true"></span>Copy</button></header>
            <pre><code data-playground-code>&lt;ContextMenu
  items='[
    <span>&#123;</span>
      "id": "context-menu-0-1",
      "key": "context-menu-0-1",
      "value": "primary",
      "label": "Primary workflow",
      "title": "Primary workflow",
      "description": "A clean default configuration for everyday product interfaces.",
      "text": "A configurable sample message.",
      "href": "#context-menu-demo",
      "actionHref": "#context-menu-demo",
      "actionLabel": "View details",
      "icon": "icon-[lucide--sparkles]",
      "iconClass": "icon-[lucide--sparkles]",
      "variant": "primary",
      "status": "Active",
      "time": "09:30",
      "current": true,
      "selected": true,
      "checked": true,
      "disabled": false,
      "outgoing": false,
      "open": true,
      "number": 1,
      "count": 16,
      "percentage": 72,
      "color": "#7c3aed",
      "target": "_self",
      "ariaLabel": "Open primary workflow 1",
      "items": [
        <span>&#123;</span>
          "label": "Nested option A",
          "value": "nested-a"
        <span>&#125;</span>,
        <span>&#123;</span>
          "label": "Nested option B",
          "value": "nested-b"
        <span>&#125;</span>
      ],
      "links": [
        <span>&#123;</span>
          "label": "Documentation",
          "href": "#documentation"
        <span>&#125;</span>,
        <span>&#123;</span>
          "label": "API reference",
          "href": "#api-reference"
        <span>&#125;</span>
      ],
      "values": [
        "Included",
        "Standard"
      ]
    <span>&#125;</span>,
    <span>&#123;</span>
      "id": "context-menu-0-2",
      "key": "context-menu-0-2",
      "value": "secondary",
      "label": "Additional option",
      "title": "Supporting example",
      "description": "A clean default configuration for everyday product interfaces.",
      "text": "Another configurable message.",
      "href": "#context-menu-demo",
      "actionHref": "#context-menu-demo",
      "actionLabel": "View details",
      "icon": "icon-[lucide--sparkles]",
      "iconClass": "icon-[lucide--sparkles]",
      "variant": "primary",
      "status": "Active",
      "time": "09:30",
      "current": false,
      "selected": false,
      "checked": false,
      "disabled": false,
      "outgoing": true,
      "open": true,
      "number": 2,
      "count": 32,
      "percentage": 72,
      "color": "#7c3aed",
      "target": "_self",
      "ariaLabel": "Open primary workflow 2",
      "items": [
        <span>&#123;</span>
          "label": "Nested option A",
          "value": "nested-a"
        <span>&#125;</span>,
        <span>&#123;</span>
          "label": "Nested option B",
          "value": "nested-b"
        <span>&#125;</span>
      ],
      "links": [
        <span>&#123;</span>
          "label": "Documentation",
          "href": "#documentation"
        <span>&#125;</span>,
        <span>&#123;</span>
          "label": "API reference",
          "href": "#api-reference"
        <span>&#125;</span>
      ],
      "values": [
        "Included",
        "Standard"
      ]
    <span>&#125;</span>
  ]'
  title="Context Menu example"
  description="A polished default context menu for a modern application."
  label="Context Menu"&gt;
  &lt;div data-slot="trigger"&gt;
    &lt;div class="showcase-slot"&gt;trigger slot&lt;/div&gt;
  &lt;/div&gt;
  &lt;div data-slot="header"&gt;
    &lt;div class="showcase-slot"&gt;header slot&lt;/div&gt;
  &lt;/div&gt;
  &lt;div data-slot="footer"&gt;
    &lt;div class="showcase-slot"&gt;footer slot&lt;/div&gt;
  &lt;/div&gt;
&lt;/ContextMenu&gt;</code></pre>
          </section>
          <div class="playground-status" data-playground-status aria-live="polite"></div>
          <div class="playground-event-log" data-playground-event-log aria-live="polite"><strong>Event output</strong><span>Interact with the preview to inspect the typed <code>payload</code>.</span></div>
        </div>
        <form class="playground-controls" data-playground-form>
          <header><div><span>Component props</span><strong>18 controls</strong></div><button type="reset"><span class="icon-[lucide--rotate-ccw] size-4" aria-hidden="true"></span>Reset</button></header>
          <div class="playground-fields"><label class="playground-field" for="playground-context-menu-items"><span><strong>items</strong><small>unknown[]</small></span><textarea id="playground-context-menu-items" name="pg_items" rows="5" spellcheck="false" data-playground-json>[
  &#123;
    "label": "Open dashboard",
    "description": "View the operational workspace",
    "value": "dashboard",
    "icon": "icon-[lucide--layout-dashboard]"
  &#125;,
  &#123;
    "label": "Share record",
    "value": "share",
    "icon": "icon-[lucide--share-2]",
    "shortcut": "Ctrl S"
  &#125;,
  &#123;
    "type": "divider"
  &#125;,
  &#123;
    "label": "Delete record",
    "value": "delete",
    "icon": "icon-[lucide--trash-2]",
    "danger": true
  &#125;
]</textarea><em data-playground-error></em></label><label class="playground-toggle" for="playground-context-menu-open"><span><strong>open</strong><small>boolean</small></span><input id="playground-context-menu-open" name="pg_open" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-context-menu-defaultOpen"><span><strong>default Open</strong><small>boolean</small></span><input id="playground-context-menu-defaultOpen" name="pg_defaultOpen" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-field" for="playground-context-menu-trigger"><span><strong>trigger</strong><small>string</small></span><select id="playground-context-menu-trigger" name="pg_trigger"><option value="click" selected>click</option><option value="contextmenu">contextmenu</option><option value="both">both</option><option value="manual">manual</option><option value="hover">hover</option><option value="focus">focus</option></select></label><label class="playground-field" for="playground-context-menu-placement"><span><strong>placement</strong><small>string</small></span><select id="playground-context-menu-placement" name="pg_placement"><option value="pointer" selected>pointer</option><option value="top-start">top-start</option><option value="top-end">top-end</option><option value="bottom-start">bottom-start</option><option value="bottom-end">bottom-end</option><option value="top">top</option><option value="right">right</option><option value="right-start">right-start</option><option value="right-end">right-end</option><option value="bottom">bottom</option><option value="left">left</option><option value="left-start">left-start</option><option value="left-end">left-end</option></select></label><label class="playground-field" for="playground-context-menu-align"><span><strong>align</strong><small>string</small></span><select id="playground-context-menu-align" name="pg_align"><option value="start" selected>start</option><option value="center">center</option><option value="end">end</option><option value="left">left</option><option value="right">right</option><option value="stretch">stretch</option></select></label><label class="playground-field" for="playground-context-menu-size"><span><strong>size</strong><small>string</small></span><select id="playground-context-menu-size" name="pg_size"><option value="default" selected>default</option><option value="sm">sm</option><option value="lg">lg</option><option value="xs">xs</option><option value="md">md</option><option value="xl">xl</option><option value="icon">icon</option><option value="icon-xs">icon-xs</option><option value="icon-sm">icon-sm</option><option value="icon-lg">icon-lg</option></select></label><label class="playground-field" for="playground-context-menu-color"><span><strong>color</strong><small>string</small></span><select id="playground-context-menu-color" name="pg_color"><option value="primary" selected>primary</option><option value="secondary">secondary</option><option value="success">success</option><option value="warning">warning</option><option value="danger">danger</option><option value="info">info</option></select></label><label class="playground-field" for="playground-context-menu-variant"><span><strong>variant</strong><small>string</small></span><select id="playground-context-menu-variant" name="pg_variant"><option value="raised" selected>raised</option><option value="default">default</option><option value="soft">soft</option><option value="outline">outline</option></select></label><label class="playground-field" for="playground-context-menu-title"><span><strong>title</strong><small>string</small></span><input id="playground-context-menu-title" name="pg_title" type="text" value="Context Menu example" /></label><label class="playground-field" for="playground-context-menu-description"><span><strong>description</strong><small>string</small></span><input id="playground-context-menu-description" name="pg_description" type="text" value="A polished default context menu for a modern application." /></label><label class="playground-field" for="playground-context-menu-label"><span><strong>label</strong><small>string</small></span><input id="playground-context-menu-label" name="pg_label" type="text" value="Context Menu" /></label><label class="playground-toggle" for="playground-context-menu-closeOnSelect"><span><strong>close On Select</strong><small>boolean</small></span><input id="playground-context-menu-closeOnSelect" name="pg_closeOnSelect" type="checkbox" value="true" checked data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-context-menu-closeOnOutside"><span><strong>close On Outside</strong><small>boolean</small></span><input id="playground-context-menu-closeOnOutside" name="pg_closeOnOutside" type="checkbox" value="true" checked data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-context-menu-disabled"><span><strong>disabled</strong><small>boolean</small></span><input id="playground-context-menu-disabled" name="pg_disabled" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-field" for="playground-context-menu-minWidth"><span><strong>min Width</strong><small>string</small></span><input id="playground-context-menu-minWidth" name="pg_minWidth" type="text" value="14rem" /></label><label class="playground-field" for="playground-context-menu-maxWidth"><span><strong>max Width</strong><small>string</small></span><select id="playground-context-menu-maxWidth" name="pg_maxWidth"><option value="20rem" selected>20rem</option><option value="compact">compact</option><option value="lg">lg</option><option value="xl">xl</option><option value="wide">wide</option><option value="2xl">2xl</option><option value="full">full</option></select></label><label class="playground-field" for="playground-context-menu-class"><span><strong>class</strong><small>string</small></span><input id="playground-context-menu-class" name="pg_class" type="text" value="showcase-instance showcase-instance--1" /></label></div>
        </form>
      </div>
    </section>
    <div class="detail-layout">
      <main class="detail-content">
        <section class="detail-section"><div class="detail-section-heading"><span>Live examples</span><h2>Designed for real product surfaces</h2><p>Compare configurations and resize the browser to check responsive behavior.</p></div><div class="demo-list">
      <article class="demo-case">
        <header class="demo-case-header">
          <div><span class="demo-case-eyebrow">Recommended</span><h2>Right-click record actions</h2><p>Expose actions that apply to the selected record or canvas location.</p></div>
          <span class="demo-case-number">01</span>
        </header>
        <div class="demo-workbench">
          <div id="context-menu-demo-1" class="demo-canvas demo-canvas--1">
            <div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
            <p class="demo-interaction-hint"><span class="icon-[lucide--mouse-pointer-click] size-4" aria-hidden="true"></span>Right-click or use the trigger button</p>
            <div class="demo-render"><ContextMenu items='[{"label":"Open dashboard","description":"View the operational workspace","value":"dashboard","icon":"icon-[lucide--layout-dashboard]"},{"label":"Share record","value":"share","icon":"icon-[lucide--share-2]","shortcut":"Ctrl S"},{"type":"divider"},{"label":"Delete record","value":"delete","icon":"icon-[lucide--trash-2]","danger":true}]' open="false" defaultOpen="false" trigger="contextmenu" placement="pointer" align="start" size="default" variant="raised" title="Record actions" description="Right-click the target surface" label="Context Menu" closeOnSelect="true" closeOnOutside="true" disabled="false" class="showcase-instance showcase-instance--1"><div data-slot="trigger"><div class="showcase-context-target">Right-click for contextual actions</div></div></ContextMenu></div>
          </div>
          <section class="demo-code" aria-label="Right-click record actions usage">
            <header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
            <pre><code>&lt;ContextMenu
  items='[
    <span>&#123;</span>
      "label": "Open dashboard",
      "description": "View the operational workspace",
      "value": "dashboard",
      "icon": "icon-[lucide--layout-dashboard]"
    <span>&#125;</span>,
    <span>&#123;</span>
      "label": "Share record",
      "value": "share",
      "icon": "icon-[lucide--share-2]",
      "shortcut": "Ctrl S"
    <span>&#125;</span>,
    <span>&#123;</span>
      "type": "divider"
    <span>&#125;</span>,
    <span>&#123;</span>
      "label": "Delete record",
      "value": "delete",
      "icon": "icon-[lucide--trash-2]",
      "danger": true
    <span>&#125;</span>
  ]'
  title="Record actions"
  description="Right-click the target surface"
  label="Context Menu"&gt;
  &lt;div data-slot="trigger"&gt;
    &lt;div class="showcase-context-target"&gt;Right-click for contextual actions&lt;/div&gt;
  &lt;/div&gt;
  &lt;div data-slot="header"&gt;
    &lt;div class="showcase-slot"&gt;header slot&lt;/div&gt;
  &lt;/div&gt;
  &lt;div data-slot="footer"&gt;
    &lt;div class="showcase-slot"&gt;footer slot&lt;/div&gt;
  &lt;/div&gt;
&lt;/ContextMenu&gt;</code></pre>
          </section>
        </div>
      </article>
      <article class="demo-case">
        <header class="demo-case-header">
          <div><span class="demo-case-eyebrow">Compact</span><h2>Click-triggered compact menu</h2><p>Use a button-triggered context menu when discoverability matters.</p></div>
          <span class="demo-case-number">02</span>
        </header>
        <div class="demo-workbench">
          <div id="context-menu-demo-2" class="demo-canvas demo-canvas--2">
            <div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
            <p class="demo-interaction-hint"><span class="icon-[lucide--mouse-pointer-click] size-4" aria-hidden="true"></span>Right-click or use the trigger button</p>
            <div class="demo-render"><ContextMenu items='[{"label":"Open dashboard","description":"View the operational workspace","value":"dashboard","icon":"icon-[lucide--layout-dashboard]"},{"label":"Share record","value":"share","icon":"icon-[lucide--share-2]","shortcut":"Ctrl S"},{"type":"divider"},{"label":"Delete record","value":"delete","icon":"icon-[lucide--trash-2]","danger":true}]' open="false" defaultOpen="false" trigger="click" align="center" size="sm" variant="secondary" title="Quick actions" description="A compact configuration for dashboards and dense product surfaces." label="Compact example" closeOnSelect="true" closeOnOutside="true" disabled="false" minWidth="12rem" class="showcase-instance showcase-instance--2"><div data-slot="trigger"><button type="button" class="showcase-action">Open quick actions</button></div></ContextMenu></div>
          </div>
          <section class="demo-code" aria-label="Click-triggered compact menu usage">
            <header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
            <pre><code>&lt;ContextMenu
  items='[
    <span>&#123;</span>
      "label": "Open dashboard",
      "description": "View the operational workspace",
      "value": "dashboard",
      "icon": "icon-[lucide--layout-dashboard]"
    <span>&#125;</span>,
    <span>&#123;</span>
      "label": "Share record",
      "value": "share",
      "icon": "icon-[lucide--share-2]",
      "shortcut": "Ctrl S"
    <span>&#125;</span>,
    <span>&#123;</span>
      "type": "divider"
    <span>&#125;</span>,
    <span>&#123;</span>
      "label": "Delete record",
      "value": "delete",
      "icon": "icon-[lucide--trash-2]",
      "danger": true
    <span>&#125;</span>
  ]'
  trigger="click"
  align="center"
  size="sm"
  variant="secondary"
  title="Quick actions"
  description="A compact configuration for dashboards and dense product surfaces."
  label="Compact example"
  minWidth="12rem"&gt;
  &lt;div data-slot="trigger"&gt;
    &lt;button type="button" class="showcase-action"&gt;Open quick actions&lt;/button&gt;
  &lt;/div&gt;
  &lt;div data-slot="header"&gt;
    &lt;div class="showcase-slot"&gt;header slot&lt;/div&gt;
  &lt;/div&gt;
  &lt;div data-slot="footer"&gt;
    &lt;div class="showcase-slot"&gt;footer slot&lt;/div&gt;
  &lt;/div&gt;
&lt;/ContextMenu&gt;</code></pre>
          </section>
        </div>
      </article>
      <article class="demo-case">
        <header class="demo-case-header">
          <div><span class="demo-case-eyebrow">Advanced</span><h2>Pointer and keyboard menu</h2><p>Support right-click, click, and keyboard activation without forcing the menu open.</p></div>
          <span class="demo-case-number">03</span>
        </header>
        <div class="demo-workbench">
          <div id="context-menu-demo-3" class="demo-canvas demo-canvas--3">
            <div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
            <p class="demo-interaction-hint"><span class="icon-[lucide--mouse-pointer-click] size-4" aria-hidden="true"></span>Right-click or use the trigger button</p>
            <div class="demo-render"><ContextMenu items='[{"label":"Open dashboard","description":"View the operational workspace","value":"dashboard","icon":"icon-[lucide--layout-dashboard]"},{"label":"Share record","value":"share","icon":"icon-[lucide--share-2]","shortcut":"Ctrl S"},{"type":"divider"},{"label":"Delete record","value":"delete","icon":"icon-[lucide--trash-2]","danger":true}]' open="false" defaultOpen="false" trigger="both" placement="bottom-start" align="end" size="lg" variant="soft" title="Accessible actions" description="A richer configuration demonstrating additional content and hierarchy." label="Advanced example" closeOnSelect="true" closeOnOutside="true" disabled="false" class="showcase-instance showcase-instance--3"><div data-slot="trigger"><button type="button" class="showcase-action">Click, press Enter, or right-click</button></div></ContextMenu></div>
          </div>
          <section class="demo-code" aria-label="Pointer and keyboard menu usage">
            <header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
            <pre><code>&lt;ContextMenu
  items='[
    <span>&#123;</span>
      "label": "Open dashboard",
      "description": "View the operational workspace",
      "value": "dashboard",
      "icon": "icon-[lucide--layout-dashboard]"
    <span>&#125;</span>,
    <span>&#123;</span>
      "label": "Share record",
      "value": "share",
      "icon": "icon-[lucide--share-2]",
      "shortcut": "Ctrl S"
    <span>&#125;</span>,
    <span>&#123;</span>
      "type": "divider"
    <span>&#125;</span>,
    <span>&#123;</span>
      "label": "Delete record",
      "value": "delete",
      "icon": "icon-[lucide--trash-2]",
      "danger": true
    <span>&#125;</span>
  ]'
  trigger="both"
  placement="bottom-start"
  align="end"
  size="lg"
  variant="soft"
  title="Accessible actions"
  description="A richer configuration demonstrating additional content and hierarchy."
  label="Advanced example"&gt;
  &lt;div data-slot="trigger"&gt;
    &lt;button type="button" class="showcase-action"&gt;Click, press Enter, or right-click&lt;/button&gt;
  &lt;/div&gt;
  &lt;div data-slot="header"&gt;
    &lt;div class="showcase-slot"&gt;header slot&lt;/div&gt;
  &lt;/div&gt;
  &lt;div data-slot="footer"&gt;
    &lt;div class="showcase-slot"&gt;footer slot&lt;/div&gt;
  &lt;/div&gt;
&lt;/ContextMenu&gt;</code></pre>
          </section>
        </div>
      </article></div></section>
        <section id="events" class="detail-section"><div class="detail-section-heading"><span>Component outputs</span><h2>Receive every typed component output</h2><p>Use declarative output handlers in <code>.wrn</code> files or register a direct output handler from JavaScript. The canonical API exposes <code>payload</code> and does not require <code>event.detail</code>.</p></div><div class="detail-events-grid"><div class="detail-events-list"><div><code>@open</code><span>Fires after the component opens.</span></div><div><code>@close</code><span>Fires after the component closes.</span></div><div><code>@select</code><span>Fires when an item, option, card, or result is selected.</span></div><div><code>@action</code><span>Fires when the component's primary or item action is activated.</span></div></div><div class="detail-event-examples"><section class="demo-code"><header><span><span class="icon-[lucide--braces] size-4" aria-hidden="true"></span>Declarative handlers</span><small>.wrn</small></header><pre><code>&lt;ContextMenu
  @open='console.log(payload)'
  @close='console.log(payload)'
  @select='console.log(payload)'
  @action='console.log(payload)'
/&gt;</code></pre></section><section class="demo-code"><header><span><span class="icon-[lucide--radio] size-4" aria-hidden="true"></span>Direct output handlers</span><small>.js</small></header><pre><code>import <span>&#123;</span> registerOutputHandler <span>&#125;</span> from "@wrnexus/csr/outputs"

const component = document.querySelector("[data-ui-component=\"ContextMenu\"], [data-component=\"ContextMenu\"]")

if (component) registerOutputHandler(component, "open", (payload) =&gt; <span>&#123;</span>
  console.log("open", payload)
<span>&#125;</span>)

if (component) registerOutputHandler(component, "close", (payload) =&gt; <span>&#123;</span>
  console.log("close", payload)
<span>&#125;</span>)

if (component) registerOutputHandler(component, "select", (payload) =&gt; <span>&#123;</span>
  console.log("select", payload)
<span>&#125;</span>)

if (component) registerOutputHandler(component, "action", (payload) =&gt; <span>&#123;</span>
  console.log("action", payload)
<span>&#125;</span>)</code></pre></section></div></div></section>
        <section id="api" class="detail-section"><div class="detail-section-heading"><span>Component API</span><h2>Props and configuration</h2><p>All content and behavior shown above is supplied through these props and slots.</p></div><div class="docs-table-wrap"><table class="docs-table"><thead><tr><th>Prop</th><th>Type</th><th>Default</th><th>Required</th></tr></thead><tbody><tr><td><code>items</code></td><td>unknown[]</td><td><code>[]</code></td><td>No</td></tr><tr><td><code>open</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>defaultOpen</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>trigger</code></td><td>string</td><td><code>"contextmenu"</code></td><td>No</td></tr><tr><td><code>placement</code></td><td>string</td><td><code>"pointer"</code></td><td>No</td></tr><tr><td><code>align</code></td><td>string</td><td><code>"start"</code></td><td>No</td></tr><tr><td><code>size</code></td><td>string</td><td><code>"default"</code></td><td>No</td></tr><tr><td><code>color</code></td><td>string</td><td><code>"primary"</code></td><td>No</td></tr><tr><td><code>variant</code></td><td>string</td><td><code>"raised"</code></td><td>No</td></tr><tr><td><code>title</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>description</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>label</code></td><td>string</td><td><code>"Context menu"</code></td><td>No</td></tr><tr><td><code>closeOnSelect</code></td><td>boolean</td><td><code>true</code></td><td>No</td></tr><tr><td><code>closeOnOutside</code></td><td>boolean</td><td><code>true</code></td><td>No</td></tr><tr><td><code>disabled</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>minWidth</code></td><td>string</td><td><code>"14rem"</code></td><td>No</td></tr><tr><td><code>maxWidth</code></td><td>string</td><td><code>"20rem"</code></td><td>No</td></tr><tr><td><code>class</code></td><td>string</td><td><code>""</code></td><td>No</td></tr></tbody></table></div></section>
      </main>
      <aside class="detail-aside">
        <div class="detail-toc"><strong>On this page</strong><a href="#playground">Playground</a><a href="#context-menu-demo-1">Right-click record actions</a><a href="#context-menu-demo-2">Click-triggered compact menu</a><a href="#context-menu-demo-3">Pointer and keyboard menu</a><a href="#events">Outputs</a><a href="#api">Props API</a></div>
      </aside>
    </div>
    <nav class="detail-pagination">
      <span></span>
      <a href="/components/drawer"><small>Next</small><strong>Drawer →</strong></a>
    </nav>
  }
}
