This document defines the current public runtime contract for ash_sdui.
Canonical runtime values
Every generated or runtime-composed screen is described by:
viewbindingsstatecontext
When a view renders through an SDUI layout tree, nodes may also declare:
bindingrefreshvariantstate_key
view
AshSDUI.View is the normalized UI model for a screen.
Major fields:
resourceuinamemodeactionrecipecontextfieldsintentsbindingsqueriesstaterelationshipsassignsrefreshworkflow
Primary entry point:
state
AshSDUI.View.State is the authoritative runtime state shape.
Fields:
queryparamsselectedloadingrefreshworkflowassigns
Definitions:
query: normalized query state for collection-oriented viewsparams: original or normalized request and event paramsselected: canonical list of selected identifiersloading: runtime loading flags keyed by feature or intent namerefresh: per-binding or per-view refresh metadataworkflow: workflow state for view-local transitionsassigns: extra runtime state outside the shared contract
bindings
ui_binding defines named data sources for a view.
Author-facing source shapes:
{:resource, resource}{:relationship, relationship}{:assign, key}{:context, key}{:runtime, key}{:selection}{:subject}{:event, key}{:poll, source, interval: ms}{:pubsub, topic, ...}{:stream, source, ...}{:actor}{:tenant}
Runtime-resolved binding fields:
refreshupdateupdate_strategysource_kindstatussubscription
Normalized refresh modes:
:manual:params:subscription{:interval, ms}
Normalized update strategies:
:replace:append:prepend:merge:remove
Public binding functions:
AshSDUI.Binding.plan/2AshSDUI.Binding.load/2AshSDUI.Binding.subscription_specs/2AshSDUI.Binding.apply_update/3
context
AshSDUI.Context carries runtime information about the current viewer or
environment.
Current fields:
actortenantlocaleaudiencedeviceassigns
ui_intent
ui_intent defines declarative user actions.
Intent metadata:
namelabelstyleiconcomponent_overridetargetconfirmplacementrequires_actor?visible_whenenabled_whenloading_whenrefreshes
Target families:
{:navigate, path}{:patch, path}{:event, event}{:ash_action, action}{:refresh, binding_or_view}{:select, operation}{:workflow, event}{:custom, module, function}
Primary intent functions:
AshSDUI.LiveResource is the default dispatcher for built-in command types.
Runtime host
AshSDUI.LiveResource is the primary runtime host for generated and
semi-generated screens.
Current responsibilities:
- resolve
AshSDUI.View - plan and load bindings
- mount and refresh runtime state
- register subscriptions
- handle binding-level live updates
- host query, refresh, select, workflow, and save event surfaces
- dispatch normalized intents
- render stock recipes or SDUI layout recipes through the same runtime contract
Layout contract
Layouts are serializable trees with this preferred public authoring API:
AshSDUI.Layout.Builder.resource/2AshSDUI.Layout.Builder.resources/3AshSDUI.Layout.fetch/2AshSDUI.Layout.register/2AshSDUI.Layout.save/3AshSDUI.Layout.publish/2AshSDUI.LiveScreen.assign_layout/3
AshSDUI.Layout.Node and AshSDUI.Renderer.TreeNode support these declarative
node metadata fields:
bindingrefreshvariantstate_key
Persisted layout guarantees
Persisted layout nodes store declarative runtime metadata only.
Runtime metadata is encoded inside static_props under an internal
__ash_sdui__ envelope so it can round-trip through stored node records.
Persisted layouts do not store:
- runtime process state
- subscription registrations
- loaded binding values
- refresh status
- workflow progress
- selection state
SDUIRoot injected assigns
AshSDUI.Components.SDUIRoot passes runtime values into layout-rendered
components.
Shared assigns:
nodeviewbindingsstatecontext
Component-facing node assigns:
binding_namebound_valuerefresh_metastate_keystate_slicenode_refreshnode_variant