function useMenuBar(options?: UseMenuBarOptions): MenuBarHandle; Follows the window's declared menu bar (Runic Desktop's DesktopMenuBarPresentation.Page) while its owner lives, as headless state for the application's own menubar component, through createMenuBarController. The controller starts with the owner's effects, so server rendering never creates one and state stays connecting. Call during component initialization (or in $effect.root); owner destruction disposes the controller.
let open = $state("");
const menuBar = useMenuBar({ onRequest: request => { if (request.kind === "open") open = request.menu.key; } });
{#if menuBar.state.placement === "page"}<Menubar.Root bind:value={open}>…{/if}