Skip to main content

Alert Widget

The Alert widget displays informational, warning, success, or error messages to users in your application interface. This widget is based on Element UI's alert component and provides various customization options.

The five alert types on a published page, in the historical look, each with a title and a description.
The five alert types on a published page, in the historical look, each with a title and a description.

OverviewDirect link to Overview

The Alert widget is a versatile notification component that can be used to:

  • Display system messages and notifications
  • Show validation feedback
  • Communicate important information to users
  • Provide contextual alerts based on user actions

Configuration PropertiesDirect link to Configuration Properties

Basic ConfigurationDirect link to Basic Configuration

Alert TypeDirect link to Alert Type

  • Field: type
  • Type: Dropdown selection
  • Options:
    • primary - Blue text and icon. On a published page in the historical look, the background stays white; the builder canvas shows it on a light blue background
    • success - Green themed alert for positive feedback (default for a new alert)
    • info - Grey, neutral alert for informational messages
    • warning - Orange/yellow themed alert for warnings
    • error - Red themed alert for errors and critical messages
  • Description: Determines the visual appearance and semantic meaning of the alert
  • Colours: the colours above are those of the historical SoftyFlow look. When the portal design is applied to the applications, the alerts take the colours of the design and of your brand (see Design and brand colours)

TitleDirect link to Title

  • Field: title
  • Type: Text input
  • Required: Optional
  • Description: The main heading text displayed at the top of the alert. It is shown as plain text: {{ }} expressions are not evaluated in the title (use the description for dynamic content)
  • Default: empty. An empty title shows no title at all
  • Note: Supports translation using the SF_translate filter

DescriptionDirect link to Description

  • Field: description
  • Type: Textarea
  • Required: Optional
  • Description: The main content/message body of the alert. Supports HTML content and {{ }} expressions (see Dynamic descriptions)
  • Default: empty. An empty description shows no message body, only the title
Changed in version 8.6

Up to version 8.5, an alert with an empty title or description showed the placeholder texts "Title" and "Description..." to your users. Since version 8.6, an empty title or description shows nothing: fill in only what you want to display. In the builder canvas, the placeholders are still shown so that you can see and select the alert; they do not appear on the published page.

Dynamic DescriptionsDirect link to Dynamic Descriptions

The description is evaluated like a small template of the alert, so you can show values of the page in it:

  • {{models.amount}}: a variable of the page.
  • {{SF_connectedUser.fullName}}: a property of the connected user.
  • {{amount}}: a bare name. Outside a loop, it reads the page variable amount. Inside a loop, it reads the field amount of the current row if a widget of the loop uses that name as its model; otherwise it still reads the page variable models.amount, which may be empty or hold another value.
  • {{comp_model.amount}}: inside a loop, any field of the current row, whether a widget uses it or not ({{SF_currentRow.amount}} is equivalent).

Example: Hello {{SF_connectedUser.fullName}}, your request <b>{{models.requestNumber}}</b> is waiting for approval.

Each expression is protected: if it cannot be computed (a variable that does not exist yet, a property of an empty value), it shows an empty text instead of breaking the alert. An expression that is not valid JavaScript is shown as written.

For security, the HTML of the description is cleaned before it is shown: <script>, <iframe>, <object> and <embed> tags are shown as text instead of being run, on… attributes (such as onclick) are removed and javascript: links are replaced by #. Use actions or the page code for behaviour, not the alert text.

Display OptionsDirect link to Display Options

ClosableDirect link to Closable

  • Field: closable
  • Type: Switch (boolean)
  • Default: true for a new alert
  • Description: When enabled, displays a close button allowing users to dismiss the alert

Show IconDirect link to Show Icon

  • Field: showIcon
  • Type: Switch (boolean)
  • Default: false
  • Description: When enabled, displays a contextual icon based on the alert type (info, success, warning, error)

CenterDirect link to Center

  • Field: center
  • Type: Switch (boolean)
  • Default: false
  • Description: Centers the alert content horizontally

Theme/EffectDirect link to Theme/Effect

  • Field: effect
  • Type: Dropdown selection
  • Options:
    • light - Light theme with subtle background
    • dark - Dark theme with bold background
  • Default: light
  • Description: Controls the visual intensity and background styling of the alert

Configuration InterfaceDirect link to Configuration Interface

When configuring the Alert widget in the low-code platform, you'll find these options in the Global card of the widget configuration panel (the Class field is in the Style card):

An info alert with an empty title: the canvas shows the "Title" placeholder, the published page shows only the description.
An info alert with an empty title: the canvas shows the "Title" placeholder, the published page shows only the description.

Step-by-Step ConfigurationDirect link to Step-by-Step Configuration

  1. Select Alert Type

    • Choose from the dropdown: Primary, Success, Info, Warning, or Error
    • This determines the color scheme and default icon
  2. Set Display Options

    • Toggle Closable to allow users to dismiss the alert
    • Toggle Show Icon to display contextual icons
    • Toggle Center to center-align the content
    • Select Theme (Light/Dark) for visual intensity
  3. Add Content

    • Enter a Title for the alert header (leave it empty for an alert without a title)
    • Add Description text for the main message body, with {{ }} expressions if needed (leave it empty for a title-only alert)

Usage ExamplesDirect link to Usage Examples

Basic Information AlertDirect link to Basic Information Alert

An info alert selected in the builder, with its Global card: type, closable, icon, theme, title and description.
An info alert selected in the builder, with its Global card: type, closable, icon, theme, title and description.

Success NotificationDirect link to Success Notification

A success alert confirming that a request was sent.
A success alert confirming that a request was sent.

Error AlertDirect link to Error Alert

An error alert explaining what to correct.
An error alert explaining what to correct.

Warning AlertDirect link to Warning Alert

A warning alert about a budget limit.
A warning alert about a budget limit.

Styling and ThemesDirect link to Styling and Themes

Primary ThemeDirect link to Primary Theme

When using type: "primary", the alert automatically applies the primary-theme-alert CSS class for custom styling integration with your application's theme.

A primary alert selected in the builder canvas, which shows it on a light blue background.
A primary alert selected in the builder canvas, which shows it on a light blue background.

Design and Brand ColoursDirect link to Design and Brand Colours

When your account applies its design to the applications (Settings › Design & colours › Apply to the applications too), the alerts follow the design: success, warning and error take the status colours of the design, info its neutral colour, and primary a soft shade of your primary brand colour if you set one (otherwise the information colour of the design). Your client CSS is loaded last and always keeps the last word.

The same five alerts with the SoftyFlow design applied to the applications and a violet primary brand colour.
The same five alerts with the SoftyFlow design applied to the applications and a violet primary brand colour.

CSS ClassesDirect link to CSS Classes

  • Field: Class, in the Style card
  • Description: Your own CSS class names (separated by spaces), added to the block that contains the alert. Target the alert inside it from your page or client CSS, for example .my-banner .el-alert { border-radius: 0; }
  • Note: Since version 8.6, these classes are applied to the alert block on the page; up to version 8.5 they were ignored
  • Dynamic classes: the brush button (Dynamic classes) next to Class has no effect on an alert: only the Class field is applied

Visual CustomizationDirect link to Visual Customization

  • Light Effect: Subtle background with standard text
  • Dark Effect: Bold background with high contrast text
  • Icons: Automatically selected based on alert type when showIcon is enabled
  • Centering: Content alignment can be controlled with the center option

Events and InteractionsDirect link to Events and Interactions

While not explicitly configured in the interface, the Alert widget supports the following events at the component level:

  • onClose: Triggered when the alert is dismissed (if closable)
  • onShow: Triggered when the alert is displayed

Best PracticesDirect link to Best Practices

When to Use Each TypeDirect link to When to Use Each Type

  • Info: General information, tips, or neutral notifications
  • Success: Successful operations, confirmations, positive feedback
  • Warning: Cautions, non-critical issues, important notices
  • Error: Failures, critical issues, validation errors
  • Primary: Brand-specific alerts or custom themed messages

Accessibility ConsiderationsDirect link to Accessibility Considerations

  • Use clear, concise titles and descriptions
  • Ensure color is not the only way to convey meaning (use icons)
  • Test with screen readers when using complex HTML in descriptions
  • Consider auto-dismissal timing for closable alerts

Design GuidelinesDirect link to Design Guidelines

  • Keep messages brief and actionable
  • Use consistent alert types across your application
  • Consider the visual hierarchy when placing alerts
  • Use closable alerts for non-critical information
  • Reserve non-closable alerts for critical system messages

Integration with Other WidgetsDirect link to Integration with Other Widgets

The Alert widget can be effectively combined with:

  • Forms: For validation feedback and submission confirmations
  • Buttons: To display action results
  • Data Tables: For operation status messages
  • Modals/Popups: For contextual notifications within dialogs

Technical ImplementationDirect link to Technical Implementation

The Alert widget is implemented using:

  • Frontend: Element UI (el-alert component)
  • Template Engine: EJS for server-side rendering
  • Styling: CSS classes with theme support
  • Localization: Built-in translation support via SF_translate

This widget seamlessly integrates with the platform's form validation, state management, and theming systems.