Notifications
lib.notify
Custom notifications with a lot of styling options.
- Lua
- JS/TS
lib.notify(data)
import lib from '@overextended/ox_lib/client'
lib.notify(data)
- id?:
string
- When set the current notification will be unique and only shown once on screen when spammed.
- title?:
string
- Must provide if there is no description
- description?:
string
- Must provide if there is no title
- Markdown support
- duration?:
number
- position?:
'top'
or'top-right'
or'top-left'
or'bottom'
or'bottom-right'
or'bottom-left'
or'center-right'
or'center-left'
- Default:
'top-right'
- Default:
- type?:
'inform'
or'error'
or'success'
- Default:
'inform'
- Default:
- style?:
table
(object
)- React CSS styling format
- icon?:
string
- Font Awesome 6 icon name
- iconColor:
string
caution
Setting iconColor
will get rid of the contrasted icon colour and it's circular background.
Usage Example
Standard
- Lua
- JS/TS
lib.notify({
title = 'Notification title',
description = 'Notification description',
type = 'success'
})
import lib from '@overextended/ox_lib/client'
lib.notify({
title: 'Notification title',
description: 'Notification description',
type: 'success'
})
Custom
- Lua
- JS/TS
lib.notify({
id = 'some_identifier',
title = 'Notification title',
description = 'Notification description',
position = 'top',
style = {
backgroundColor = '#141517',
color = '#909296'
},
icon = 'ban',
iconColor = '#C53030'
})
import lib from '@overextended/ox_lib/client'
lib.notify({
id: 'some_identifier',
title: 'Notification title',
description: 'Notification description',
position: 'top',
style: {
backgroundColor: '#141517',
color: '#909296'
},
icon: 'ban',
iconColor: '#C53030'
})