Post Editor Module
The postModule()
function registers a new module in your Nexo Maker expansion. It ties together metadata, shared variables, UI components, and YAML paths for activation.
This function is synchronous and does not return any values.
Modules are global by nature, which means any registered module can be seen by the renderer as long as module conditions
are met.
📘 Syntax
🧩 Parameters
title
(string) Human-readable name shown in the editor.id
(string) Unique identifier for internal reference.type
(string) Category of the module (e.g."modules"
).condition
(string[]) [optional] Array of condition keys; the module only shows if all conditions are truthy. If no conditions are given, any Nexo Maker element type can use this module.description
(string) [optional] Brief description shown in tooltips or lists.variables
(string[]) [optional] Names of shared variables to register inmodule.variables
.components
(array) [optional] UI components to render, each binding to a shared variable and a YAML path.
✔️ condition
condition
Declares which element types are considered valid to display the module.
🔁 variables
variables
Declares which shared variables this module will read/write.
Registers
test
andmaterials
in the globalmodule.variables
store.Other modules referencing these names will see updates.
🧩 components
components
Defines one or more interactive UI elements tied to shared variables and YAML.
Each component object supports:
title
(string) Label shown next to the input.element
(string) Type of UI control (e.g."input/text"
,"input/number"
,"input/checkbox"
, etc.).placeholder
(string) [optional] Default placeholder text for input fields.value
(string) Key inmodule.variables
to bind the component’s value.module
(string) Slash-delimited YAML path where this component’s value is stored and used to detect module activation.
📤 How It Works
Add variables & metadata
Register module into expansion
Render component
The
"Test"
input displays the currentmaterials
value (or the placeholder5
if unset).Changes are instantly reflected in element's yaml file.
Persist to YAML
For example, if you have a yaml file located at
Projects/my-project/Nexo/valuables/items.yaml
:Updated input data would get written into
items.yam
file, which would look something like this after editing elementvalue
input:
✅ Full Example
Condition: only shows if editing ITEM
element type.
Variable binding: shares materials
with other modules.
YAML path: writes under the material:
key.
⚠️ Notes
Choose unique, descriptive keys to avoid naming collisions.
Writing to a variable in one module immediately affects any other module reading it.
Last updated