Skip to content

Configuration

You configure global defaults under the toastify key in nuxt.config.ts. These become the baseline for every toast, and the module passes them straight to the vue3-toastify container.

export default defineNuxtConfig({
modules: ['nuxt-toastify'],
toastify: {
autoClose: 2000,
position: 'top-right',
theme: 'auto',
},
})

Out of the box, the module applies these defaults so toasts look and behave well with no configuration:

OptionDefault
multipletrue
newestOnTopfalse
dangerouslyHTMLStringfalse
clearOnUrlChangefalse
rtlfalse
autoClose5000
hideProgressBarfalse
pauseOnHovertrue
pauseOnFocusLosstrue
closeOnClicktrue
theme'auto'

Anything you set under the toastify key overrides these, and any option you don’t set falls back to vue3-toastify’s own default.

The toastify key accepts the underlying vue3-toastify container props:

OptionTypeDefaultDescription
position'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right''top-right'Where toasts appear on screen.
autoClosenumber | false5000Delay in ms before a toast closes. false keeps it open until dismissed.
theme'auto' | 'light' | 'dark' | 'colored''auto'Visual theme. 'auto' follows the system / html.dark preference.
transition'bounce' | 'slide' | 'flip' | 'zoom' (or a custom transition)'bounce'Enter/leave animation.
multiplebooleantrueAllow several toasts at once. When false, a new toast replaces the current one.
limitnumber(unlimited)Maximum number of toasts shown at the same time.
newestOnTopbooleanfalseStack the newest toast on top.
hideProgressBarbooleanfalseHide the auto-close progress bar.
pauseOnHoverbooleantruePause the auto-close timer while hovering.
pauseOnFocusLossbooleantruePause the timer when the window loses focus.
closeOnClickbooleantrueDismiss a toast when it’s clicked.
closeButtonboolean | VNode(default button)Replace the close button, or false to hide it.
rtlbooleanfalseRender right-to-left.
clearOnUrlChangebooleanfalseClear all toasts on client-side route changes.
dangerouslyHTMLStringbooleanfalseAllow rendering raw HTML strings in toast content.
rolestring'alert'ARIA role applied to toasts for assistive technology.
containerClassNamestring''Extra CSS class on the toast container.
toastClassNamestring''Extra CSS class on each toast.
bodyClassNamestring''Extra CSS class on the toast body.
progressClassNamestring''Extra CSS class on the progress bar.
styleCSSProperties(none)Inline styles for the container.
iconIconType(per-type icon)Custom default icon for toasts.

For the complete, always-current list of container props, see the vue3-toastify container API.

The module writes your toastify options into Nuxt’s public runtime config (so the client plugin can read them) as well as the private one. Avoid putting secrets in toastify — these values ship to the browser.

  • Usage — override any of these per toast at call time.
  • Examples — position and styling recipes.