ctx.modal
A shortcut API based on Ant Design Modal, used to actively open modal boxes (information prompts, confirmation pop-ups, etc.) in RunJS. It is implemented by ctx.viewer / the view system.
Use Cases
Note:
ctx.modalis available in RunJS environments with a view context (such as JSBlocks within a page, workflows, etc.); it may not exist in the backend or non-UI contexts. It is recommended to use optional chaining (ctx.modal?.confirm?.()) when calling it.
Type Definition
ModalConfig is consistent with the configuration of Ant Design Modal static methods.
Common Methods
Configuration Parameters
Consistent with Ant Design Modal, common fields include:
Relationship with ctx.message and ctx.openView
Examples
Simple Information Modal
Confirmation Modal and Flow Control
Confirmation Modal with onOk
Error Prompt
Related
- ctx.message: Lightweight temporary prompt, disappears automatically
- ctx.exit(): Commonly used as
if (!confirmed) ctx.exit()to terminate the flow when a user cancels confirmation - ctx.openView(): Opens a custom view, suitable for complex interactions

