Custom Styling
Nuxt Toastify injects vue3-toastify’s styles for you, so toasts look right out of the box. You can still theme them, change the animation, hook in your own classes, and even render rich content.
Themes
Section titled “Themes”Set the visual theme globally. 'auto' follows the system / html.dark preference:
export default defineNuxtConfig({ modules: ['nuxt-toastify'], toastify: { theme: 'colored', // 'auto' | 'light' | 'dark' | 'colored' },})Or per toast:
useToastify.success('Saved!', { theme: 'dark' })Transitions
Section titled “Transitions”Change the enter/leave animation with transition:
export default defineNuxtConfig({ modules: ['nuxt-toastify'], toastify: { transition: 'slide', // 'bounce' | 'slide' | 'flip' | 'zoom' },})// or per toastuseToastify('Whoosh', { transition: 'zoom' })Progress bar
Section titled “Progress bar”The auto-close progress bar is shown by default. Hide it globally or per toast:
export default defineNuxtConfig({ modules: ['nuxt-toastify'], toastify: { hideProgressBar: true, },})useToastify('No progress bar on this one', { hideProgressBar: true })Custom CSS classes
Section titled “Custom CSS classes”Attach your own classes to the container, each toast, the body, or the progress bar — handy for hooking into a design system or framework utilities:
export default defineNuxtConfig({ modules: ['nuxt-toastify'], toastify: { toastClassName: 'my-toast rounded-xl font-medium', bodyClassName: 'my-toast-body', progressClassName: 'my-progress', containerClassName: 'my-toast-container', },})You can also pass toastClassName (and friends) per toast for one-off styling.
HTML content
Section titled “HTML content”To render an HTML string, opt in with dangerouslyHTMLString:
useToastify('<strong>Done!</strong> Your export is ready.', { dangerouslyHTMLString: true,})Rendering a Vue component
Section titled “Rendering a Vue component”For rich, interactive content, pass a render function that returns a VNode instead of a plain string:
<script setup lang="ts">import { h } from 'vue'
function richToast() { useToastify( () => h('div', [ h('strong', 'Upload complete'), h('p', 'profile-photo.png is now live.'), ]), { autoClose: 6000 }, )}</script>
<template> <button @click="richToast">Show rich toast</button></template>Next steps
Section titled “Next steps”- Configuration — the complete option reference.
- Usage — promises, updating toasts in place, and programmatic removal.