Toastflow
Playground
Nuxt

Nuxt Module Options

Configure nuxt-toastflow module options such as config defaults, CSS injection, and component naming directly in nuxt.config.

nuxt-toastflow adds Nuxt-specific wiring around the shared Toastflow config.

config
ToastConfig
Shared Toastflow runtime config. Default: {}.
css
boolean
Toggle shipped CSS injection. Default: true.
componentName
string | false
Rename or disable the auto-registered container. Default: "ToastContainer".
components
boolean
Auto-register the remaining components (Toast, icons, …). Default: true.

Full Example

nuxt.config.ts
export default defineNuxtConfig({
  modules: ["nuxt-toastflow"],
  toastflow: {
    css: true,
    componentName: "ToastContainer",
    config: {
      position: "top-right",
      alignment: "left",
      duration: 5000,
      maxVisible: 5,
      queue: true,
      pauseOnHover: true,
    },
  },
});

Option Details

JSON-Serializable Config

Do not put functions in toastflow.config. Nuxt config is serialized. Use per-toast callbacks like onClose, onClick, or button onClick at runtime.
runtime/toast.ts
toast.success({
  title: "Saved",
  onClose() {
    console.log("toast closed");
  },
});

Runtime exports

Import ToastContainer, Toast, toast, types, or lower-level runtime pieces explicitly.

Nuxt notes

Client-only usage, SSR boundaries, and practical app patterns.
Copyright © 2026