Skip to content

SonnerNextIntlProvider

SonnerNextIntlProvider<M>(props): Element

Defined in: packages/sonner-next-intl/src/context.tsx:98

Provider component that wires sonner plus next-intl translator into the React context for descendant components to consume via useConfig.

The component expects the full context shape as props. This design keeps the provider API explicit and simple: you pass a toast implementation, the messages object for the current locale and a translator instance.

M extends Record<string, any>

The shape of the messages object for translations.

object & ContextType<M>

Props for the provider.

Element

The provider wrapping the children.

<SonnerNextIntlProvider
toast={toast}
messages={messages}
translator={translator}
>
<App />
</SonnerNextIntlProvider>