Notification
Simple use case
exports["g-notifications"]:Notify({
title = "Announcement",
description = "Announcement server",
type = "info",
})
exports["g-notifications"]:Notify({
id = "Title", -- (string) Unique identifier for the notification (optional)
title = "Title", -- (string) Title text displayed on the notification
description = "Description", -- (string) Main message or description text
duration = 5000, -- (number) Duration in milliseconds the notification stays visible
showDuration = true, -- (bool) Show countdown timer bar (true/false)
type = "info", -- (string) Notification type: "info" | "success" | "warn" | "error" | "default"
position = "top-right", -- (string) Position on screen:
-- "bottom-left" | "bottom-right" | "bottom-center" | "top-left" | "top-right" | "top-center" | "center" | "top-full" | "bottom-full"
EnableSound = true, -- (bool) Play a notification sound (true/false)
soundName = "notification1", -- (string) Sound file name from `g-notifications/web/build/audio/` folder (.ogg format only)
variant = "type3", -- (string) Notification style variant: "type1" | "type2" | "type3" | "type4"
styles = { -- (table) Custom styles for notification colors (all optional)
["bgcolor"] = "#003f2d", -- Background color
["iconbg"] = "#00b37e", -- Icon background color
["iconColor"] = "#fff", -- Icon color
["textColor"] = "#ffffff" -- Text color
},
icon = "bell" -- (string) Icon name from FontAwesome free icons [https://fontawesome.com/icons?d=gallery&s=solid&m=free]
})
Server-Side Notification
TriggerClientEvent("g-notification:notify", source, {
title = "Server Notification",
description = "This notification was sent from the server!",
type = "info", -- success | error | warn | info
position = "top-right", -- refer to the g-notifications config
duration = 5000,
showDuration = true
})
Positions
"bottom-left" | "bottom-right" | "bottom-center" | "top-left" | "top-right" | "top-center" | "center" | "top-full" | "bottom-full"
Notification Variations
"type1" | "type2" | "type3" | "type4"
Types
"info" | "success" | "warn" | "error" | "default" -- or you can create your own type via config
Icons
Last updated