Notification

Customizable notifications with positioning, styling, and type-based appearance

Options

OptionTypeRequiredDefaultDescription
titlestringNonilNotification title
messagestringYes*nilNotification message
typestringNo'info'Type: 'info', 'success', 'warning', 'error'
durationnumberNo5000Duration in milliseconds
positionstringNo'top-right'Position: 'top-left', 'top-center', 'top-right', 'center-left', 'center', 'center-right', 'bottom-left', 'bottom-center', 'bottom-right'
iconstringNonilFontAwesome icon class
iconColorstringNoAutoIcon color (hex)
bgColorstringNoAutoBackground color (hex)
txtColorstringNoAutoText color (hex)

*Either title or message is required.

Note:

  • 'description' is an alias for 'message'.

Example

exports.lation_ui:notify({
    title = 'Success',
    message = 'Profile updated successfully',
    type = 'success',
})
 
exports.lation_ui:notify({
    title = 'Error',
    message = 'Failed to save changes',
    type = 'error',
})
 
exports.lation_ui:notify({
    title = 'Warning',
    message = 'Your session is about to expire',
    type = 'warning',
})
 
exports.lation_ui:notify({
    title = 'Info',
    message = 'New features are now available',
    type = 'info',
})
 
exports.lation_ui:notify({
    message = 'A notification with only a message',
})
 
exports.lation_ui:notify({
    title = 'Custom',
    message = 'A notification with custom styles',
    bgColor = '#e35c5c',
    icon = 'fas fa-screwdriver-wrench',
    iconColor = '#3a3a3a',
    txtColor = '#e5e5e5',
})
 
exports.lation_ui:notify({
    title = 'Custom',
    message = 'A notification with custom styles',
    bgColor = '#bd71f2',
    icon = 'fas fa-bars',
    iconColor = '#3a3a3a',
    txtColor = '#e5e5e5',
})