World commands with Minecraft menu constituents.
Preview
Usage
The example records a real action callback and controls a coordinate checkbox with checked and onCheckedChange. closeOnClick={false} keeps the checkbox menu open while changing the preference.
Composition
Content owns portal/positioning, defaults to bottom/start with sideOffset 4, and accepts surface="popup" or "suggestions". Use Group with Label, RadioGroup with RadioItem, and Sub with SubTrigger/SubContent for their respective behaviors. Shortcuts only display hints.
Interaction and limits
Only the default Item variant is supported; destructive styling throws. Menu rows, checkbox captions and panel artwork have declared native cases. Their combined dropdown arrangement and browser keyboard interactions remain web adaptations. Persist preference state in your application.
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 * as React from "react";
import { Button } from "./button";
import { minecraftCardSprite } from "./minecraft-card-sprite";
import { MinecraftMenuCheckboxSprite } from "./minecraft-menu-checkbox";
import {
MenuScaleContext,
MinecraftMenuText,
menuTextNodes,