Skip to content

st.notify / st.s_notify — Notifications ​

NotifyProps class ​

lua
---@class NotifyProps
---@field id?           string            Unique ID (for persistent notifications)
---@field title?        string
---@field description?  string
---@field duration?     number            Milliseconds (default 3000)
---@field showDuration? boolean
---@field position?     NotificationPosition
---@field type?         NotificationType
---@field style?        table             CSS overrides
---@field icon?         string | table    FontAwesome icon name or {iconProp, string}
---@field iconAnimation? IconAnimationType
---@field iconColor?    string
---@field alignIcon?    'top' | 'center'
---@field sound?        { bank?: string, set: string, name: string }
---@field persistent?   boolean           Keep until dismissed (use st.persistentNotification)

NotificationPosition: 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left' | 'center-right' | 'center-left'

NotificationType: 'info' | 'warning' | 'success' | 'error'

IconAnimationType: 'spin' | 'spinPulse' | 'spinReverse' | 'pulse' | 'beat' | 'fade' | 'beatFade' | 'bounce' | 'shake'

Deprecated server form ​

lua
-- Deprecated but still works via st.notify from server:
st.notify(source, data)  -- @deprecated, use st.s_notify