MagicMirror² DocsMagicMirror² Docs
Donate
Discord
Forum
GitHub
Donate
Discord
Forum
GitHub
  • Getting Started

    • Introduction
    • Requirements
    • Installation & Usage
    • Upgrade Guide
  • Configuration

    • Introduction
    • Autostart your MagicMirror²
    • Raspberry Specific
  • Modules

    • Introduction
    • Module Configuration
    • Default Modules

      • Alert
      • Calendar
      • Clock
      • Compliments
      • Hello World
      • News Feed
      • Update Notification
      • Weather Module
    • Animation Guide
  • Module Development

    • Introduction
    • The Core module file
    • The Node Helper
    • MagicMirror Helper Methods
    • Logger
    • Notifications
    • Weather Module Weather Provider Development
    • How to write good documentation
  • About

    • MagicMirror² Manifesto
    • Contributing Guidelines
    • Donate
    • Support
    • License

Alert

The alert module is one of the default modules of the MagicMirror. This module displays notifications from other modules.

Usage

To use this module, add it to the modules array in the config/config.js file:

modules: [
	{
		module: "alert",
		config: {
			// The config property is optional.
			// See 'Configuration options' for more information.
		}
	}
]

Configuration options

The following properties can be configured:

OptionDescription
effectThe animation effect to use for notifications.

Possible values: scale slide genie jelly flip exploader bouncyflip
Default value: slide
alert_effectThe animation effect to use for alerts.

Possible values: scale slide genie jelly flip exploader bouncyflip
Default value: jelly
display_timeTime a notification is displayed in milliseconds.

Possible values: int
Default value: 3500
positionPosition where the notifications should be displayed.

Possible values: left center right
Default value: center
welcome_messageMessage shown at startup.

Possible values: string false
Default value: false (no message at startup)

Developer notes

For notifications use:

self.sendNotification("SHOW_ALERT", {type: "notification"});

For alerts use:

self.sendNotification("SHOW_ALERT", {});

Notification params

OptionDescription
titleThe title of the notification. Can contain text or html.
titleTypeThe title type of the notification.

Possible values: text or html
Default value: html
messageThe message of the notification. Can contain text or html.
messageTypeThe message type of the notification.

Possible values: text or html
Default value: html
timer (optional)How long the notification should stay visible in ms.
If absent, the default display_time is used.

Possible values: int float

Alert params

OptionDescription
titleThe title of the alert. Can contain text or html.
titleTypeThe title type of the alert.

Possible values: text or html
Default value: html
messageThe message of the alert. Can contain text or html.
messageTypeThe message type of the alert.

Possible values: text or html
Default value: html
imageUrl (optional)Image to show in the alert

Possible values: url path
Default value: none
imageFA (optional)Font Awesome icon to show in the alert

Possible values: See Font Awesome website.
Default value: none
imageHeight (optional even with imageUrl set)Height of the image

Possible values: intpx
Default value: 80px
timer (optional)How long the alert should stay visible in ms.

Important: If you do not use the timer, it is your duty to hide the alert by using self.sendNotification("HIDE_ALERT");!

Possible values: int float
Default value: none

Open Source Licenses

NotificationStyles

See tympanus.net for license.

Help us improve this page!
Last Updated:: 4/30/25, 8:00 PM
Next
Calendar