Skip to main content

Alert

Rocket 2.0

The Alert component shows a short message in a colored box, such as a warning, an error or a success note. It can include a button for a follow-up step and a close button.

Properties​

Property
Description
Expected Value
TitleBold heading of the alert.Text. Default: Heads up
DescriptionText shown under the title.Text
Action labelText of a button shown under the description. The button appears only when this has a value.Text
Show close buttonShows a close button in the corner that hides the alert.On or off. Default: Off
VariantColor and icon of the alert. Info, Success, Warning and Destructive use the theme's status colors; Custom uses the Custom accent style.Default, Info, Success, Warning, Destructive, Custom. Default: Default
Show iconShows the icon that matches the Variant. Default and Custom have no icon.On or off. Default: On
Loading lookWhat shows while the component is loading: a Spinner or a grey Skeleton block.Spinner, Skeleton. Default: Spinner

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
Dynamic heightLets the component grow with its content in the running app instead of keeping a fixed height.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 action clickedTriggers when the user clicks the action button.
On closeTriggers when the alert is closed, by the close button or the Dismiss action.

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
Set titleChanges the alert's title to Title.components.alert1.setTitle("New title")
Set descriptionChanges the alert's description to Description.components.alert1.setDescription("New description")
Set variantChanges the alert's look to Variant, such as info, success, warning or destructive.components.alert1.setVariant("info")
ShowShows the alert again after it was closed.components.alert1.show()
DismissHides the alert and fires On close.components.alert1.dismiss()
Set visibilityShows the component when true, hides it when false.components.alert1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.alert1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.alert1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
titleBold heading of the alert.{{components.alert1.title}}
descriptionText shown under the title.{{components.alert1.description}}
actionLabelText of a button shown under the description. The button appears only when this has a value.{{components.alert1.actionLabel}}
dismissibleShows a close button in the corner that hides the alert.{{components.alert1.dismissible}}
variantColor and icon of the alert. Info, Success, Warning and Destructive use the theme's status colors; Custom uses the Custom accent style.{{components.alert1.variant}}
showIconShows the icon that matches the Variant. Default and Custom have no icon.{{components.alert1.showIcon}}
loadingIndicatorWhat shows while the component is loading: a Spinner or a grey Skeleton block.{{components.alert1.loadingIndicator}}
dismissedtrue while the alert is closed.{{components.alert1.dismissed}}
isVisibleWhether the component is visible.{{components.alert1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.alert1.isLoading}}
isDisabledWhether the component is disabled.{{components.alert1.isDisabled}}

Styles​

Style
Default
Alert backgroundTheme: Surface 1
Alert border colorTheme: Default border
Custom accentTheme: Brand primary
Alert title colorTheme: Primary text
Alert description colorTheme: Primary text
Alert 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.