Types
Concepts & types (brief)
Section titled “Concepts & types (brief)”-
createUseTranslatedToast<M>()— factory that returns a typeduseTranslatedToasthook bound to your app messages typeM. -
useTranslatedToast(options?)— hook returned by factory; returns{ toast }wheretoasthas the same methods as Sonner but expectsTranslatedMessage<T>objects. -
TranslatedMessage<T>— a string or the descriptor you pass instead of a string. Shape:{ key: NamespacedKey, type: 'regular' | 'raw' | 'rich' | 'markup', data?: Record<string, any>, formats?: Formats }regular— normal interpolated string usingtranslator(key, data, formats)raw—t.raw(key)(no data/formats)rich—t.rich(key, data)(returns React nodes via next-intl rich tags)markup—t.markup(key, data)(returns markup string)
-
notificationsRoot(ConfigOptions) — optional namespace key to prefix message keys for all toast titles/descriptions.
Read the Full API Reference for more details.