Elyra
Elyra The coding agent e The native code editor Elyra Grove Native local development environment Askr The real server for Laravel & PHP Elyra Framework Rust + Svelte 5 framework for desktop apps Elyra Conductor Local project conductor Elyra SQL Server MySQL-compatible SQL server in Rust Elyra Félagi Agents as teammates on one board Elyra SQL Client Native desktop SQL workbench Elyra SQL Anywhere Replication-ready SQL engine Elyra Sjá SEO & GEO workspace for macOS Elyra DataGrid Server-driven data grid for Laravel
Release notes
Changelog
Elyra
Application menu

Application menu

Define custom submenus with Menu / Submenu and pass them to App::menu. They're appended after the standard app + Edit menus, and clicking an item emits the elyra:menu event carrying the item id.

use elyra::{App, Menu, Submenu};

App::new()
    .title("MyApp")
    .menu(
        Menu::new()
            .submenu(
                Submenu::new("File")
                    .item_accel("file.new", "New", "CmdOrCtrl+N")
                    .item_accel("file.save", "Save", "CmdOrCtrl+S")
                    .separator()
                    .item("file.export", "Export…"),
            )
            .submenu(
                Submenu::new("View")
                    .item_accel("view.reload", "Reload", "CmdOrCtrl+R"),
            ),
    )
    .run()

Handle clicks on the frontend:

import { onMenu } from "@elyra/runtime";

onMenu((id) => {
  switch (id) {
    case "file.new": /* … */ break;
    case "file.export": /* … */ break;
  }
});

Accelerators use the same syntax as global shortcuts (CmdOrCtrl+S, Shift+Alt+F, …).

Platform support

Platform How it renders
macOS the application menu bar, alongside the built-in app/Edit menus and the About item
Windows a per-window menu bar (init_for_hwnd), plus a Help ▸ About <App> item
Linux a per-window GTK menu bar, plus a Help ▸ About <App> item

Item clicks arrive on elyra:menu on every platform. The macOS Edit menu (which is what makes ⌘C/⌘V/⌘X reach the webview) is macOS-only by nature; elsewhere the clipboard shortcuts are handled by the platform itself.

Related