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 🙏

© 2024 – Pkg Stats / Ryan Hefner

snackbar-messages-nuxt

v1.0.1

Published

snackbar messages module for nuxt

Downloads

123

Readme

Nuxt Snackbar Messages

npm version npm downloads License Nuxt

A module that makes it easy to add and use snackbar messages at a nuxt application.

This module currently depends on @pinia/nuxt and vuetify-nuxt-module

Features

  • Easy to use add and remove messages functions
  • Messages easily displayed with the used of a single component
  • 4 types of messages: Error, Info, Warn, Success
  • Optional timeout for messages

Quick Setup

Before installing the module it is necessary to install the nuxt modules @pinia/nuxt and vuetify-nuxt-module:

yarn dlx nuxi module add pinia
yarn dlx nuxi module add vuetify-nuxt-module

Then install the module to your Nuxt application with one command:

yarn dlx nuxi module add snackbar-messages-nuxt

That's it! You can now use Nuxt Snackbar Messages in your Nuxt app ✨

Usage

Vue Component

For the module to work it is necessary to add the SnackbarMessages component inside the v-app component from vuetify:

<v-app>
  <!-- Your content -->

  <SnackbarMessages />
</v-app>

Obs.: Everything should work fine even if SnackbarMessages isn't an imediate child of v-app.

New Message

To create a new message just call the addMessage function and the message will appear at the bottom right side of the screen:

const messageId = addMessage({
  type: MessageType.Success,
  message: 'Your success message',
  timeout: 2000,
});

addMessage requires the following arguments

  • *type: Type of the message that requires one of the values from the MessageType enum, that is also available
  • *message: The string message that will be shown
  • timeout: An optional timeout in milliseconds determining in how much time the message will be removed

addMessage returns an number that is the id of the created message, which can be used to manually remove it

Removing Message

All messages can be removed by the user and will be removed after the timeout, if provided, but you can also do so manully using the removeMessage function and the id that is returned when it is created by the addMessage function:

removeMessage(
  messageId,
);

# Install dependencies
yarn install

# Generate type stubs
yarn dev:prepare

# Develop with the playground
yarn dev

# Build the playground
yarn dev:build