# Notifications

### QBCore Implementation

```lua
function QBCore.Functions.Notify(text, textype, length)
    if type(text) == "table" then
        local ttext = text.text or 'Placeholder'
        local caption = text.caption or 'Placeholder'
        local icon = text.icon or 'fas fa-inbox'
        local length = length or 3000
        exports['ZSX_UI']:AddNotify(icon, caption, ttext, length)
    else
        local ttext = text or 'Placeholder'
        local length = length or 5000
        exports['ZSX_UI']:AddNotify('fas fa-inbox', 'Notification', ttext, length)
    end
end
```

### ESX Implementation

```lua
function ESX.ShowNotification(message, type, length)
    if Config.NativeNotify then
        BeginTextCommandThefeedPost('STRING')
        AddTextComponentSubstringPlayerName(message)
        EndTextCommandThefeedPostTicker(0, 1)
    else
        exports['ZSX_UI']:AddNotify('fas fa-inbox', 'Notification', message, length)
    end
end
```

### Usage

<pre class="language-lua"><code class="lang-lua"><strong>exports['ZSX_UI']:AddNotify('fas fa-inbox', 'Notification', 'This is my test notification.', 5000)
</strong></code></pre>

```lua
TriggerEvent('ZSX_UI:addNotify', 'fas fa-inbox', 'Notification', 'This is my test notification.', 5000)
```

### Structure

Export

```lua
exports['ZSX_UI']:AddNotify(icon, header, text, time)
```

Event

```lua
TriggerEvent('ZSX_UI:addNotify', icon, header, text, time)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zsx-development.gitbook.io/docs/resources/user-interface/notifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
