npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nuxt-toast

v1.4.0

Published

A Nuxt module for iziToast notifications

Downloads

18,769

Readme

Nuxt Toast

npm version npm downloads License Nuxt

A Nuxt module for easily integrating iziToast notifications into your Nuxt 4 application.

Features

  • 🔔  Easily show toast notifications in your Nuxt 4 app
  • 🎨  Customizable styles and icons
  • ⚡  Supports auto-imported composable (useToast() by default)
  • 🔧  Fully configurable via nuxt.config.ts
  • 🔄  Supports changing the composable name dynamically

Quick Setup

Install the module to your Nuxt application with one command:

npx nuxi module add nuxt-toast

Manual Installation

If you prefer to install manually, run:

# Using npm
npm install nuxt-toast

# Using yarn
yarn add nuxt-toast

# Using pnpm
pnpm add nuxt-toast

# Using bun
bun add nuxt-toast

Then, add it to your Nuxt config:

export default defineNuxtConfig({
  modules: [
    'nuxt-toast'
  ]
})

🚀 Usage

Once installed, you can use useToast() anywhere in your Nuxt app:

Basic Example

<script setup>
const toast = useToast()

toast.success({ title: 'Success!', message: 'Your action was completed successfully.' })
toast.error({ title: 'Error!', message: 'Something went wrong.' })
toast.info({ title: 'Info', message: 'Here is some information.' })
toast.warning({ title: 'Warning!', message: 'Be careful with this action.' })
toast.question({ title: 'Confirmation', message: 'Are you sure you want to continue with this action?' })
</script>

Customizing Toast Appearance & Options

<script setup>
useToast().show({
	title: 'Title',
	message: 'Message',
	timeout: 3000,
	position: 'topCenter',
	layout: 2,
	...options,
})
</script>

Dynamically Hiding Toasts

<script setup>
const toast = useToast()

// Show a toast
toast.error({
	title: 'Error!',
	message: 'An issue occurred.',
	timeout: 30000,
})

// Hide the toast after 5 seconds
setTimeout(() => {
	toast.hideToast('Error!', 'An issue occurred.', 'error')
}, 5000)
</script>

Configuration Options

You can configure the module in your nuxt.config.ts:

export default defineNuxtConfig({
  modules: ['nuxt-toast'],
  toast: {
    composableName: 'useNotification', // Customize the composable name
    settings: {
      // Global iziToast settings applied to all toasts
      rtl: true,
      position: 'topCenter',
      timeout: 3000,
      // ... see https://github.com/marcelodolza/iziToast for all options
    }
  }
})

Customizing the Composable Name

If you've modified the composableName in nuxt.config.ts:

export default defineNuxtConfig({
  toast: { composableName: 'useNotification' }
})

Then use the updated composable name in your component:

<script setup>
useNotification().success({
  title: 'Success!',
  message: 'You did it!',
})
</script>

Global iziToast Settings

You can pass any iziToast configuration options through the settings property:

export default defineNuxtConfig({
  toast: {
    settings: {
      rtl: true,              // Right-to-left support
      position: 'topRight',    // Default position
      timeout: 5000,          // Default timeout
      closeOnEscape: true,    // Close on ESC key
      closeOnClick: true,     // Close on click
      pauseOnHover: true,     // Pause on hover
      // ... and many more options
    }
  }
})

This ensures consistency with your custom naming convention. 🚀