Skip to main content

Dialog

Rocket 2.0

The Dialog component opens a window over the app with a title, a description, an area for other components and Confirm and Cancel buttons. Use it to confirm a risky action or to collect details in a small form without leaving the page.

Properties​

Property
Description
Expected Value
Button labelText on the button that opens the dialog.Text. Default: Delete account
Button variantLook of the button that opens the dialog.default, secondary, outline, destructive. Default: outline
TitleHeading at the top of the dialog.Text. Default: Are you absolutely sure?
DescriptionText under the title, such as what the action will do.Text. Default: This action cannot be undone. This will permanently delete your account and remove your data.
Confirm labelText on the confirm button.Text. Default: Continue
Cancel labelText on the cancel button.Text. Default: Cancel
Destructive confirmMakes the confirm button red, for actions that delete or remove data.On or off. Default: On
Components in the bodyAdds an area under the description for other components, such as a form. What users type there is kept when the dialog closes.On or off. Default: On
Confirm and cancel buttonsShows the confirm and cancel buttons at the bottom of the dialog.On or off. Default: On
Body height (px)Height of the components area in pixels.Number. Default: 240

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On closeTriggers when the dialog closes for any reason.
On openTriggers when the dialog opens.
On confirmTriggers when the user clicks the confirm button.
On cancelTriggers when the user dismisses the dialog with the cancel button, the close icon, the Escape key or a click on the backdrop.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
OpenOpens the dialog.components.dialog1.open()
CloseCloses the dialog. It fires On close but not On cancel.components.dialog1.close()
Set visibilityShows the component when true, hides it when false.components.dialog1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.dialog1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.dialog1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
triggerTextText on the button that opens the dialog.{{components.dialog1.triggerText}}
triggerVariantLook of the button that opens the dialog.{{components.dialog1.triggerVariant}}
titleHeading at the top of the dialog.{{components.dialog1.title}}
descriptionText under the title, such as what the action will do.{{components.dialog1.description}}
confirmTextText on the confirm button.{{components.dialog1.confirmText}}
cancelTextText on the cancel button.{{components.dialog1.cancelText}}
destructiveMakes the confirm button red, for actions that delete or remove data.{{components.dialog1.destructive}}
showBodyAdds an area under the description for other components, such as a form. What users type there is kept when the dialog closes.{{components.dialog1.showBody}}
showFooterShows the confirm and cancel buttons at the bottom of the dialog.{{components.dialog1.showFooter}}
bodyHeightHeight of the components area in pixels.{{components.dialog1.bodyHeight}}
showtrue while the dialog is open.{{components.dialog1.show}}
isVisibleWhether the component is visible.{{components.dialog1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.dialog1.isLoading}}
isDisabledWhether the component is disabled.{{components.dialog1.isDisabled}}

Styles​

Style
Default
Button backgroundTheme: Surface 1
Button textTheme: Primary text
Dialog backgroundTheme: Surface 1
Dialog radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.