Skip to main content

Element Actions

Actions for reading and writing interactive element state, and the events they emit.

input-changed — stdui → App

Emitted when the user commits a change to any interactive element.

{ "action": "input-changed", "data": { "id": "volume", "value": "0.75", "pane": "main" } }
FieldDescription
idThe element's id attribute
valueThe new value as a string. For checkboxes: "true" or "false"
paneThe id of the pane the element belongs to

button-clicked — stdui → App

Emitted when a <ui-button> is clicked. data contains all HTML attributes of the button plus a pane field.

{ "action": "button-clicked", "data": { "action": "save", "text": "Save", "pane": "main" } }
FieldDescription
paneThe id of the pane the button belongs to
All other HTML attributes of the <ui-button> element

set-value — App → stdui

Programmatically set the value of an element by id.

{ "action": "set-value", "data": { "id": "username", "value": "Alice" } }

get-value — App → stdui

Request the current value of an element by id. stdui responds with a value-result event.

The data field may be a plain string (the id) or an object with an id field:

{ "action": "get-value", "data": "username" }
{ "action": "get-value", "data": { "id": "username" } }

value-result — stdui → App

Emitted in response to a get-value request.

{ "action": "value-result", "data": { "id": "username", "value": "Alice" } }
FieldDescription
idThe element's id attribute
valueCurrent value as a string, or "" if the id has never been rendered or set