Notification
Customizable notifications with positioning, styling, and type-based appearance
Options
Option | Type | Required | Default | Description |
---|---|---|---|---|
title | string | No | nil | Notification title |
message | string | Yes* | nil | Notification message |
type | string | No | 'info' | Type: 'info' , 'success' , 'warning' , 'error' |
duration | number | No | 5000 | Duration in milliseconds |
position | string | No | 'top-right' | Position: 'top-left' , 'top-center' , 'top-right' , 'center-left' , 'center' , 'center-right' , 'bottom-left' , 'bottom-center' , 'bottom-right' |
icon | string | No | nil | FontAwesome icon class |
iconColor | string | No | Auto | Icon color (hex) |
bgColor | string | No | Auto | Background color (hex) |
txtColor | string | No | Auto | Text 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',
})