Skip to content
Axiom/Docs
Capabilities / ui.overlay

ui.overlay

@1

The retained widget tree. A mod describes a panel, the host keeps it and renders it every frame without asking again, and what crosses the boundary is the diff rather than the draw calls.

Retained rather than immediate for one reason: an immediate mode call per row would be a crossing per row, so a panel of sixty rows would cost sixty crossings every frame. Here a frame where nothing changed costs nothing.

Styling is not a mod's. Panels inherit the overlay's tokens so twelve mods look like one application, which is why no call here takes a font, a colour or a corner radius. A mod that wants its own pixels wants canvas, which is deliberately a different capability.

11 callsSurface as of 2026-10-21

Types

TYPESfrom the IDL
struct PanelId { index: u32, generation: u32 }
struct NodeId { index: u32, generation: u32 }

Calls

panel
panel(title: str) -> Result<PanelId>

A top level panel, which gets its own tab in the overlay.

In C, from surface.h
int32_t axiom_ui_overlay_panel(const char* title, uint32_t title_length, AxiomUiOverlayPanelId* out);
list
list(panel: PanelId) -> Result<NodeId>

A list whose contents are replaced wholesale. The replacement is diffed host side, so a list that did not change costs nothing.

The cells come row after row, and columns says how many make a row. Flat rather than a list of rows each holding a list of cells, because that is a span of structs of spans, and the ABI keeps a struct's bytes meaning the same thing on both sides only when it holds no spans.

In C, from surface.h
int32_t axiom_ui_overlay_list(uint32_t panel_index, uint32_t panel_generation, AxiomUiOverlayNodeId* out);
setWRITES
set(list: NodeId, cells: [str], columns: u32) -> Result<>
In C, from surface.h
int32_t axiom_ui_overlay_set(uint32_t list_index, uint32_t list_generation, const AxiomSpan* cells, uint32_t cells_count, uint32_t columns);
table
table(panel: PanelId, columns: [str]) -> Result<NodeId>

A table is a list with headers, set the same way.

In C, from surface.h
int32_t axiom_ui_overlay_table(uint32_t panel_index, uint32_t panel_generation, const AxiomSpan* columns, uint32_t columns_count, AxiomUiOverlayNodeId* out);
textWRITES
text(panel: PanelId, line: str) -> Result<>

Text, already formatted: arguments are marshalled once on the guest side rather than a format string and a list crossing together.

In C, from surface.h
int32_t axiom_ui_overlay_text(uint32_t panel_index, uint32_t panel_generation, const char* line, uint32_t line_length);
sliderWRITES
slider(panel: PanelId, label: str, bound: str) -> Result<>

Controls bound to a config key, so persistence and validation come from the schema rather than from each mod doing its own.

In C, from surface.h
int32_t axiom_ui_overlay_slider(uint32_t panel_index, uint32_t panel_generation, const char* label, uint32_t label_length, const char* bound, uint32_t bound_length);
toggleWRITES
toggle(panel: PanelId, label: str, bound: str) -> Result<>
In C, from surface.h
int32_t axiom_ui_overlay_toggle(uint32_t panel_index, uint32_t panel_generation, const char* label, uint32_t label_length, const char* bound, uint32_t bound_length);
selectWRITES
select(panel: PanelId, label: str, bound: str) -> Result<>
In C, from surface.h
int32_t axiom_ui_overlay_select(uint32_t panel_index, uint32_t panel_generation, const char* label, uint32_t label_length, const char* bound, uint32_t bound_length);
buttonWRITES
button(panel: PanelId, label: str, id: str) -> Result<>

A button fires through the mod's event callback on its own thread, next frame. It does not fire inside the click, which matters to anyone expecting to read input state in it.

In C, from surface.h
int32_t axiom_ui_overlay_button(uint32_t panel_index, uint32_t panel_generation, const char* label, uint32_t label_length, const char* id, uint32_t id_length);
graphWRITES
graph(panel: PanelId, label: str, value: f32, window: u32) -> Result<>

A rolling series. The host keeps the ring buffer, so a mod pushes one value a frame rather than an array every frame.

In C, from surface.h
int32_t axiom_ui_overlay_graph(uint32_t panel_index, uint32_t panel_generation, const char* label, uint32_t label_length, float value, uint32_t window);
noteWRITES
note(panel: PanelId, text: str) -> Result<>

Quiet explanatory text, for saying why something is unavailable.

In C, from surface.h
int32_t axiom_ui_overlay_note(uint32_t panel_index, uint32_t panel_generation, const char* text, uint32_t text_length);

Events

pressedpanel: PanelId, id: str

Errors

A call that returns Result crosses as a status: 0 is success, and the others are these errors, by their index in the capability.

NoSurfaceStalePanelUnknownBinding