Skip to main content

Core Actions

settings — App → stdui

Configure the window and application on startup. Send this as the very first message after spawning the process; stdui blocks on startup until it is received.

{
"action": "settings",
"data": {
"title": "My App",
"windowWidth": 1280,
"windowHeight": 720,
"baseFontSize": 14,
"audioVolume": 0.5,
"resizable": true
}
}

All fields in data are optional. Only provided fields are applied; omitted fields keep their defaults.

FieldTypeDefaultDescription
titlestring"StdUI"Window title bar text
resizablebooleantrueEnable or disable window resizing
windowWidthnumber800Window width in pixels
windowHeightnumber600Window height in pixels
windowMinWidthnumber400Minimum allowed window width in pixels
windowMinHeightnumber300Minimum allowed window height in pixels
windowMaxWidthnumber3840Maximum allowed window width in pixels
windowMaxHeightnumber2160Maximum allowed window height in pixels
baseFontSizenumber16.0Base UI font size in pixels
audioVolumenumber1.0Audio volume level (0.0 to 1.0)
fontRegularstring""Filename of the regular font file (empty = ImGui default)
fontBoldstring""Filename of the bold font file
fontItalicstring""Filename of the italic font file
fontBoldItalicstring""Filename of the bold italic font file
colorSchemeobjectColor palette for the ImGui layer. See Color Scheme
targetFpsnumber60Target frame rate in frames per second

Color Scheme

The colorScheme object controls colors used by the ImGui layer (window backgrounds, buttons, borders, text, etc.). HTML content styled via CSS in your update-content strings is unaffected.

All values are hex strings in #RRGGBB or #RRGGBBAA format (e.g. #0969da33 for 20% opacity). Omitted fields fall back to the built-in light theme defaults. text and textMuted are auto-derived from windowBg when omitted.

FieldDefaultDescription
windowBg#ffffffBackground of all pane windows
text#1f2328Primary foreground text (auto-derived from windowBg if omitted)
textMuted#656d76Secondary / muted text (auto-derived from text if omitted)
elementBg#f6f8faDefault background of interactive elements
elementHovered#eaeef2Background of interactive elements on hover
elementActive#d0d7deBackground of interactive elements while pressed
titleBg#f6f8faBackground of ImGui window title bars
border#d0d7deElement and window border color
primary#0969daAccent color used for buttons and focus rings
primaryTranslucent#0969da 80% alphaSemi-transparent variant of primary
primarySubtle#0969da 10% alphaVery lightly tinted background derived from primary
textSelectionBg#0969da 20% alphaSelected-text highlight color
warn#9a6700Warning indicators
danger#d1242fDestructive actions and error indicators
modalDim#000000 30% alphaOverlay color drawn behind modal dialogs

Example — dark theme:

{
"action": "settings",
"data": {
"colorScheme": {
"windowBg": "#0d1117",
"text": "#e6edf3",
"textMuted": "#7d8590",
"elementBg": "#161b22",
"elementHovered": "#1f2937",
"elementActive": "#2d333b",
"titleBg": "#161b22",
"border": "#30363d",
"primary": "#2f81f7",
"warn": "#d29922",
"danger": "#f85149"
}
}
}

update-content — App → stdui

Sets the HTML content rendered in a pane. There is no incremental patching — each call replaces the entire content of the target pane.

Plain string (targets the default "main" pane):

{ "action": "update-content", "data": "<h1>Hello</h1>" }

Object form (targets a named pane):

{ "action": "update-content", "data": { "pane": "sidebar", "content": "<h1>Hello</h1>" } }
FieldDescription
paneID of the target pane, as declared in set-pane-layout
contentHTML string to render

ready — stdui → App

Emitted once the window and all subsystems are fully initialized. Do not send update-content until this is received.

{ "action": "ready" }

close — App → stdui

Instructs stdui to close the window and exit cleanly. stdui emits window-closed in response.

{ "action": "close" }

window-closed — stdui → App

Emitted when the user closes the window (or after a close action). The controlling app should use this as its shutdown signal.

{ "action": "window-closed" }

log — stdui → App

Emitted for all internal log messages, including output from raylib.

{ "action": "log", "data": { "namespace": "Main", "message": "Raylib initialized" } }
FieldDescription
namespaceCategory or subsystem that produced the message (e.g. "Main", "Font")
messageThe log message text