> For the complete documentation index, see [llms.txt](https://zsx-development.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zsx-development.gitbook.io/docs/resources/user-interface-v2/exports/interfaces/default-notifications.md).

# Default Notifications

The notification system is designed to display messages that pop up above the minimap, ensuring they are noticeable and non-intrusive during gameplay.

### Add

In order to add default notification you can use the export:

<pre class="language-lua"><code class="lang-lua"><strong>local serial = exports['ZSX_UIV2']:DefaultNotification(data)
</strong></code></pre>

Data is an object that contains:

```lua
-- Example with header
local data = {
    header = 'fas fa-envelope',
    text = 'My default notification'
}
-- Example without header
local data = {
    text = 'My default notification'
}

local data = {
    header = {
            text = 'RESPECT',
            color = "#ee1c3e",
            icon = 'fas fa-chevron-down'
    },
    text = 'Your respect is low!'
}

-- Example with header as image (url)
local data = {
    header = 'https://r2.fivemanage.com/9fHGnEBEfnR89IeQ0njaD/Vector4.png',
    text = 'My default notification with image!'
}
```

<table><thead><tr><th width="121">Key</th><th width="523">Value</th><th data-type="checkbox">Optional</th></tr></thead><tbody><tr><td>header</td><td><mark style="color:green;">String</mark> / <mark style="color:yellow;">Object</mark><br>Icon of the default notification.</td><td>true</td></tr><tr><td>text</td><td><mark style="color:green;">String</mark><br>Text of the default notification.</td><td>false</td></tr><tr><td>progress</td><td><mark style="color:yellow;">Object</mark><br>Creates progress instead of text. Check example <a href="#progress">below</a>.</td><td>false</td></tr><tr><td>persistent</td><td><mark style="color:orange;">Boolean</mark><br>Sets default notification as persistent. You need to remove it later manually!</td><td>true</td></tr></tbody></table>

### Header object

<table><thead><tr><th width="169">key</th><th width="468">value</th><th data-type="checkbox">Optional</th></tr></thead><tbody><tr><td>text</td><td><mark style="color:green;">String</mark><br>Text before the icon</td><td>false</td></tr><tr><td>color</td><td><mark style="color:purple;">HEX</mark><br>Hex color of the icon</td><td>true</td></tr><tr><td>icon</td><td><mark style="color:purple;">Icon</mark><br>Icon of the header object. List of <a href="https://fontawesome.com/v5/search?q=">icons</a>.</td><td>false</td></tr></tbody></table>

{% hint style="info" %}
The export returns a **serial**, which can be useful if you need to remove it later.
{% endhint %}

### Remove

To remove a notification before its time elapses, you need to retrieve the **serial** from the previously added notification. Use this serial to identify and remove the notification.

```lua
exports['ZSX_UIV2']:DefaultNotification_Remove(serial)
```

### Progress

To create default notification as progress, you can use the following example:

```lua
local data = {
    header = 'Engine',
    progress = { value = 10 },
}
```
