This document lists the public package surface for ash_sdui.
Preferred authoring path
Prefer these layers in order:
AshSDUI.LiveResourceview/2,ui_field/2,ui_nested_form/2,ui_intent/2,ui_query/2, andui_binding/2ash_sdui_view_opts/4recipe_overrides- custom recipe modules
- custom
render/1or full custom LiveViews
Prefer these APIs:
AshSDUI.Layout.Builder.resource/2AshSDUI.Layout.Builder.resources/3AshSDUI.Layout.fetch/2AshSDUI.Layout.register/2AshSDUI.Layout.save/3AshSDUI.Layout.publish/2AshSDUI.LiveScreen.assign_layout/3AshSDUI.Form.fields/2AshSDUI.Form.nested_forms/2
Compatibility-only path:
Core modules
| Module | Purpose |
|---|---|
AshSDUI.LiveResource | Generated and semi-generated runtime host |
AshSDUI.View | Resolved screen metadata and normalized UI model |
AshSDUI.Binding | Binding planning, loading, subscriptions, and live updates |
AshSDUI.Intent | Declarative action normalization and command envelopes |
AshSDUI.Layout | Public API for registered and stored layout trees |
AshSDUI.Layout.Builder | Preferred builder for layout authoring |
AshSDUI.LiveScreen | Helper for assigning ephemeral runtime layouts |
AshSDUI.Form | Metadata-driven form field introspection |
AshSDUI.Components.NestedForm | Recursive renderer for generated nested relationship forms |
AshSDUI.Components.SDUIRoot | Runtime bridge for layout-rendered components |
AshSDUI.Storybook | Storybook integration for generated views and SDUI trees |
Main functions
AshSDUI.Layout
| Function | Purpose |
|---|---|
fetch/2 | Return a named layout definition from registered or stored sources |
register/2 | Register a code-authored layout by name |
save/3 | Persist a layout tree through AshSDUI.UINode or a compatible resource |
publish/2 | Mark stored layout nodes as published |
load_nodes/2 | Return stored node records for a layout name |
AshSDUI.Layout.Builder
| Function | Purpose |
|---|---|
resource/2 | Build a node from a UI module or annotated resource |
resources/3 | Build one node per record from a UI module or annotated resource |
node/2 | Build a generic layout node |
register/2 | Register a built layout and return the layout name |
to_tree/1 | Convert a layout definition node into a renderable tree node |
AshSDUI.LiveScreen
| Function | Purpose |
|---|---|
assign_layout/3 | Register, evict, render, and assign an ephemeral layout |
AshSDUI.Form
| Function | Purpose |
|---|---|
fields/2 | Return ordered generated-form field metadata for an action |
nested_forms/2 | Return ordered generated nested-form metadata for an action |
Metadata sources
Use resource metadata as the source of truth:
view/2ui_field/2ui_nested_form/2ui_intent/2ui_query/2ui_binding/2
Generated forms should use widget: when a field should render :textarea,
:email, :select, :multiselect, or another non-default input. Relationship
selectors may also declare relationship:, option_label:, option_value:,
prompt:, read_action:, option_filter:, and option_sort:.
Generated nested relationship forms should use ui_nested_form/2. Supported
metadata includes:
relationshiplabel/label_keystyleallow_add?allow_remove?allow_sort?collapsed_by_default?interaction_mode
Binding source families
Supported ui_binding source families:
{:resource, resource}{:relationship, relationship}{:assign, key}{:context, key}{:runtime, key}{:selection}{:subject}{:event, key}{:poll, source, interval: ms}{:pubsub, topic, ...}{:stream, source, ...}{:actor}{:tenant}
Refresh modes
Supported normalized refresh modes:
:manual:params:subscription{:interval, ms}
Update strategies
Supported normalized update strategies:
:replace:append:prepend:merge:remove
Intent target families
Supported ui_intent target families:
{:navigate, path}{:patch, path}{:event, event}{:ash_action, action}{:refresh, binding_or_view}{:select, operation}{:workflow, event}{:custom, module, function}
Supported behavioral metadata:
visible_whenenabled_whenloading_whenrefreshes
Runtime contract fields
Shared runtime values:
viewbindingsstatecontext
Node-level runtime metadata:
bindingrefreshvariantstate_key
AshSDUI.Components.SDUIRoot injects component-facing runtime assigns:
binding_namebound_valuerefresh_metastate_keystate_slicenode_refreshnode_variant