Skip to content

ProcessDialog ​

ProcessDialog is the frame of a dialog that runs a process: what it does, its fields, and the actions to run it or to cancel it.

When to use ​

Use it for an operation that takes settings before it runs, such as a conversion, an export or an operation on a selection. The application passes the fields as children, runs the process on onrun, sets running (and progress when it can tell) while it runs, and closes the dialog when it is done. It shows why a run failed in error, and stops a run on oncancel. To ask before an action that takes no settings, use a Confirm.

Props ​

PropDefaultDescription
openfalseWhether the dialog is open (bindable)
titlerequiredThe title in the head
descriptionWhat the process does, above the fields
errorWhy the last run failed, in a red notice at the top
runLabelrun messageThe run action
runningTextrunning messageWhat shows while running
runningfalseThe process runs
progressHow far it is, 0 to 100; without it, indeterminate
disabledfalseThe run action cannot be pressed
onrunCalled when the run action is pressed
oncancelCalled when the user closes the dialog
sizemdThe width, as Modal's size
inlinefalseThe same surface in the flow of a page
childrenThe fields

Contract ​

A Modal whose body reads in a fixed order: the error in a Banner, the description, then the fields, gap-lg apart; the three are gap-md apart. The Footer holds cancel and the run action, the primary one. While running, the body shows a Spinner with the running text and a Progress instead, and the run action is busy. Cancel, the close button and Escape call oncancel whenever they close the dialog, also while it runs; when the application closes it by setting open to false, oncancel is not called.

Example ​

ProcessDialog

Released under the Apache-2.0 license.