Skip to content
Docs
Reference

ui global

The retained Menu and HUD and their primitives, generated from the shipped declarations.

Generated from the declarations in @disko-game/build/types. See Menus & HUD for a guide.

The ui global

The retained Menu and HUD.

ts

UI

Disko.UiStyle

A frozen style created by ui.style.

ts

Disko.UiStyleDeclarations

Style declarations: sizes in pixels or CSS-like strings, colors as tokens or hex.

ts

Disko.UiTheme

A frozen theme created by ui.theme.

ts

Disko.UiRequest

A request to the game when a control is used, created by ui.request.

ts

Disko.UiLocalCommand

A local client-side command such as ui.open(modal).

ts

Disko.UiSwap

A content replacement pushed with ui.push.

ts

Disko.UiNode

A retained UI node.

ts

Disko.UiContent

Content accepted wherever children are.

ts

Disko.UiTrigger

A semantic trigger, independent of the input device.

ts

Disko.UiTargetReference

A node, or a target relative to the source: itself, its nearest form or slot.

ts

Disko.UiValue

A value carried by UI controls and local commands.

ts

Disko.UiRequirement

Gates a node on a permission. Recipients without it do not receive the node and its subtree (denied: "hide", the default), or receive them disabled and without server requests (denied: "disable").

ts

Disko.UiOptions

Options shared by every UI primitive.

ts
MemberDescription
requiresHides or disables this node for players without the permission.
nameForm field name.
altAlternative text of an image.
[index]Direct style properties are accepted beside style.

Disko.UiPlayerOptions

Options of a primitive that shows one player.

ts

Disko.UiValueSchema

The closed schema of the values a request carries.

ts

Disko.UiSwapMethod

How the response content is placed at the target.

ts

Disko.UiConcurrencyPolicy

ts

Disko.UiRequestOptions

Options of ui.request.

ts
MemberDescription
eventThe ui-request event name the game receives.
targetWhere the response goes; defaults to the source ("this").
swapDefaults to "replace".
valuesValues collected by the client; defaults to "none".
concurrencyDefaults to "queue" with a limit of one.
payloadSchemaDefaults to { type: "null" }.
requiresOnly players with this permission can use the request; for the others the control is disabled and carries no request.

Disko.UiPrimitive

A UI primitive constructor.

ts

Disko.Ui

The retained UI API: Menu, HUD and their primitives.

ts
MemberDescription
menu()Sets the Menu, shown while the room is not playing or on Esc.
hud()Sets the HUD of the running match.
push()Publishes swaps to everyone, or only to one player.
flag()A player's country flag; player is required.
connection()A player's connection quality; player is required.
playerName()A player's name in the room's color with its badge, rendered by the client; the node holds only the player's identity. player is required.