Skip to Content

Notifications

Display styled notifications with icons, sounds, and animations.

Client Exports

notify

Send a custom notification with full control over appearance.

exports['trinity-ui']:notify(data)

Parameters:

PropertyTypeDefaultDescription
titlestringβ€”Notification title
descriptionstringβ€”Message text (alias: message)
idstring | numberautoUnique ID β€” reuses existing notification if matched
durationnumber5000Auto-hide duration in milliseconds
positionstringConfig valueScreen position (see below)
typestringβ€”'info' | 'warning' | 'success' | 'error'
iconstringβ€”Iconify icon name (e.g. 'fa6-solid:check')
iconAnimationstringβ€”'spin' | 'spinPulse' | 'pulse' | 'beat' | 'fade' | 'beatFade' | 'bounce' | 'shake'
iconColorstringβ€”Icon color (hex)
alignIconstringβ€”'top' | 'center'
styletableβ€”Custom CSS styles
soundtableβ€”Sound to play (see below)

Positions: 'top' 'top-right' 'top-left' 'bottom' 'bottom-right' 'bottom-left' 'center-right' 'center-left'

Sound Table:

sound = { bank = 'DLC_HEIST_HACKING_SNAKE_SOUNDS', -- Audio bank name set = 'HUD_MINI_GAME_SOUNDSET', -- Sound set name = 'PICK_UP' -- Sound name }

Example:

exports['trinity-ui']:notify({ title = 'Success', description = 'Item purchased successfully!', type = 'success', icon = 'fa6-solid:check', duration = 5000, position = 'top-right' })

You can also pass a simple string:

exports['trinity-ui']:notify('Hello world!')

defaultNotify

Send a notification using a predefined type style.

exports['trinity-ui']:defaultNotify(data)

Parameters:

PropertyTypeDefaultDescription
titlestringβ€”Notification title
descriptionstringβ€”Message text
typestring'info''info' | 'warning' | 'success' | 'error'

Example:

exports['trinity-ui']:defaultNotify({ title = 'Warning', description = 'You are running low on fuel.', type = 'warning' })

Server-Side Usage

trinity.notify

Send a notification to a specific player from the server.

trinity.notify(source, data)

Example:

trinity.notify(source, { title = 'Welcome', description = 'Welcome to the server!', type = 'info' })

trinity.notifyAll

Broadcast a notification to all connected players.

trinity.notifyAll(data)

Events

You can also trigger notifications via events:

-- Client-side TriggerEvent('trinity-ui:notify', data) -- Server to client TriggerClientEvent('trinity-ui:notify', source, data) TriggerClientEvent('trinity-ui:defaultNotify', source, data)

ox_lib compatibility events ox_lib:notify and ox_lib:defaultNotify are also supported automatically.

Last updated on