Positioning
Position is set with the position option, and how long a toast stays is set with autoClose (in milliseconds). You can configure both globally for every toast, or override them for a single call.
Position (global)
Section titled “Position (global)”Set a default corner for every toast in nuxt.config.ts:
export default defineNuxtConfig({ modules: ['nuxt-toastify'], toastify: { position: 'bottom-center', },})The available positions are: top-left, top-center, top-right, bottom-left, bottom-center, and bottom-right.
Position (per toast)
Section titled “Position (per toast)”Override the position for a single toast. Use the ToastifyOption.POSITION constants for typo-safe values:
<script setup lang="ts">function notify() { useToastify('Top left', { position: ToastifyOption.POSITION.TOP_LEFT, })
useToastify('Bottom right', { position: ToastifyOption.POSITION.BOTTOM_RIGHT, })}</script>
<template> <button @click="notify">Notify</button></template>The plain strings ('top-left', 'bottom-right', …) work too — the constants are just a convenience.
Duration: global default
Section titled “Duration: global default”autoClose is the number of milliseconds a toast stays before it auto-dismisses. The module default is 5000 (5 seconds). Change it globally:
export default defineNuxtConfig({ modules: ['nuxt-toastify'], toastify: { autoClose: 3000, // every toast stays 3 seconds by default },})Duration: per-toast override
Section titled “Duration: per-toast override”Pass autoClose to useToastify() to override the global default for just that toast:
// This one stays much longer than the global defaultuseToastify.info('Read me carefully.', { autoClose: 12000,})A toast that never auto-closes
Section titled “A toast that never auto-closes”Set autoClose: false to keep a toast open until it’s clicked or removed programmatically:
const id = useToastify('Action required — click to dismiss.', { autoClose: false,})
// remove it yourself when appropriate:// useToastify.remove(id)Next steps
Section titled “Next steps”- Custom Styling — themes, transitions, custom classes, and HTML content.
- Configuration — the full list of global options.