A keyboard-accessible command bar made of Minecraft menu parts.
Preview
Usage
Use Menubar once around multiple MenubarMenu roots. Each Menu owns a Trigger and Content. The example exposes Game and World menus whose items update the visible action result.
Composition
MenubarMenu is a Base UI Menu.Root, distinct from the outer Menubar primitive. Triggers default to Grasscn Buttons; Content owns portal positioning and defaults to bottom/start with sideOffset 4. Checkbox/radio and submenu exports follow the menu part model.
Interaction and limits
Use the menu keyboard model for traversal rather than adding competing arrow handlers. Shortcuts are display-only. The combined command bar is a web adaptation; its buttons, labels, checkboxes and surfaces retain only their declared native constituent coverage.
See the upstream API for the underlying part and event contracts.
Installation
Component source
This is the component implementation. Its supporting styles, helpers and resources are also required. See complete manual installation.
"use client";
import { Menu as Primitive } from "@base-ui/react/menu";
import { Menubar as MenubarPrimitive } from "@base-ui/react/menubar";
import * as React from "react";
import { Button } from "./button";
import { minecraftCardSprite } from "./minecraft-card-sprite";
import { MinecraftMenuCheckboxSprite } from "./minecraft-menu-checkbox";
import {
MenuScaleContext,
MinecraftMenuText,