Skip to content

Notification ui-notification Added In: v0.5.0

Known in Dashboard 1.0 as a "Toast", this widget displays text/HTML in a small window that will appear on the screen for a defined duration of time (timeout) and at a defined location on the screen (position).

If you want to have the notification show indefinitely, you can set timeout to 0. It will not be possible to close the notification manually unless you also set allowDismiss or allowConfirm to true.

Properties

PropDynamicDescription
UIUnlike most widgets, notifications are owned by a "UI", not Group. This allows for notifications to be displayed across all pages.
PositionThe position on the screen where the the notification will appear.
ColorThe color that should be used for the notification border.
TimeoutNumber of seconds before the notification will automatically close.
Show Countdown BarWhether or not to show a reducing progress bar to indicate the time remaining before the notification will close.
Allow Manual DismissalShow a button for users to dismiss the notification. Otherwise, will only close after Timeout.
Allow Manual Dismissal - Button LabelIf "Allow Manual Dismissal" is enabled, this is the label for the button.
Allow Manual ConfirmationShow a button for users to confirm the notification. Otherwise, will only close after Timeout.
Allow Manual Confirmation - Button LabelIf "Allow Manual Confirmation" is enabled, this is the label for the button.
Accept RawWhether you're passing in raw HTML that should be processed client-side.
ClassAppends CSS classes to the widget

Dynamic Properties

Dynamic properties are those that can be overriden at runtime by sending a particular msg to the node.

Where appropriate, the underlying values set within Node-RED will be overriden by the values set in the received messages.

PropPayloadStructuresExample Values
Disabled Statemsg.enabledBoolean
Allow confirmationmsg.ui_update.allowConfirmBoolean
Allow dismissalmsg.ui_update.allowDismissBoolean
Colormsg.ui_update.colorString
Confirmation button textmsg.ui_update.confirmTextString
Dismissal button textmsg.ui_update.dismissTextString
Display time(out)msg.ui_update.displayTimeNumber
Positionmsg.ui_update.position
  • top right
  • top center
  • top left
  • bottom right
  • bottom center
  • bottom left
  • center center
Progress bar colormsg.ui_update.progressColorString
Accept raw htmlmsg.ui_update.rawBoolean
Show countdown barmsg.ui_update.showCountdownBoolean

Controls

msg.ExampleDescription
showtrue | falseAllow control over whether or not the notification is visible.

Example

Example of rendered NotificationExample of rendered Notification in a Dashboard with a progress bar showing how long left until it will automatically close.

This notification was created using a msg.payload of:

html
<h3>Generated Notification</h3><p>This is custom HTML injected into <b>Node-RED</b></p>

Sending to all clients

Notifications are, by default, constrained to send to a single user/client. In Dashboard 2.0 this constraint is defined by msg._client. You can read more about this here.

If you want to send a notification to all connected clients, you can remove the msg._client value using a "change" node, configured to "Delete" the _client property.