Menus

zero-native can configure native app menus from app.zon or typed Zig data. Menu items dispatch through the same command path as shortcuts, native controls, tray actions, and bridge commands.

.menus = .{
    .{
        .title = "View",
        .items = .{
            .{ .label = "Refresh", .command = "app.refresh", .key = "r", .modifiers = .{ "primary" } },
            .{ .separator = true },
        },
    },
},

Generated runners load app.zon menus automatically. Pass menus to runWithOptions when an app needs to override the manifest at runtime:

const view_items = [_]zero_native.MenuItem{
    .{
        .label = "Refresh",
        .command = "app.refresh",
        .key = "r",
        .modifiers = .{ .primary = true },
    },
};

const menus = [_]zero_native.Menu{
    .{ .title = "View", .items = &view_items },
};

try runner.runWithOptions(app.app(), .{
    .app_name = "native-shell",
    .bundle_id = "dev.zero_native.native_shell",
    .menus = &menus,
}, init);

When a user selects a command-backed menu item, the runtime emits Event.command with source = .menu, the active native window_id, and the item command name.

The macOS, Linux, and Windows system-WebView backends apply configured menus as native app/window menus. Backends that do not implement native menus return UnsupportedService for non-empty menu lists.