minuit

CommandPaletteComponent

A search box that finds and runs commands from the keyboard.

Java

Inside a PanelComponent constructor. The same call draws in every family and chroma.

Java
CommandPaletteComponent palette = new CommandPaletteComponent(bounds(), this)
        .group("World",
                Command.of("Teleport home", this::home).icon(Icon.GLOBE).shortcut("H").keywords("spawn", "bed"),
                Command.of("Save now", this::save).icon(Icon.DOWNLOAD).shortcut("Ctrl+S"))
        .group("Look", Command.of("Change theme", this::theme).icon(Icon.PALETTE))
        .recent(config.recentCommands)
        .onRun(c -> config.recentCommands = palette.recent());
add(palette); // last
// and from your own key handling, or a button:
palette.open();

Variants

Open

CommandPaletteComponent, open

Search

The letters that matched are marked.

CommandPaletteComponent, search: The letters that matched are marked.