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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ssdcode/vue-notification

v0.1.3

Published

Component for displaying notifications with help of also included Vuex module

Readme

Vue Notification

Component for displaying notifications with help of also included Vuex module.

Please note that this component uses Vue 3 composition api

Installation

npm install -D @ssdcode/vue-notification

Usage

First register the module with your vuex store - there are 2 options:

notification: displays only a single notification at any given time replacing previous with the new one

import Vue from 'vue';
import Vuex from 'vuex';
import { notification } from '@ssdcode/vue-notification';

Vue.use(Vuex);

export default new Vuex.Store({
  modules: { notification },
});

notifications: displays multiple notifications as they are dispatched

import Vue from 'vue';
import Vuex from 'vuex';
import { notifications } from '@ssdcode/vue-notification';

Vue.use(Vuex);

export default new Vuex.Store({
  modules: { notification: notifications },
});

Register NotificationContainer component and add it to your application's html structure.

import { NotificationContainer } from '@ssdcode/vue-notification';


new Vue({
  store,
  components: { NotificationContainer },
  render: h => h(App),
}).$mount('#app');

Example layout using tailwindcss:

<notification-container
  class="fixed inset-x-0 top-0"
  v-slot="{ notification, dismiss }"
>
  <div
    class="relative"
    :class="[notification.type === 'error' ? 'bg-red-600' : 'bg-green-600']"
  >
    <div class="max-w-screen-xl mx-auto py-3 px-3 sm:px-6 lg:px-8">
      <div class="pr-16 sm:text-center sm:px-16">
        <p class="font-medium text-white">
          <span v-html="notification.message"></span>
        </p>
      </div>
      <div
        class="absolute inset-y-0 right-0 pt-1 pr-1 flex items-start sm:pt-1 sm:pr-2 sm:items-start"
      >
        <button
          type="button"
          class="flex p-2 rounded-md focus:outline-none transition ease-in-out duration-150"
          :class="[
            notification.type === 'error'
              ? 'hover:bg-red-500 focus:bg-red-500'
              : 'hover:bg-green-500 focus:bg-green-500',
          ]"
          aria-label="Dismiss"
          @click="dismiss"
        >
          <svg
            class="h-6 w-6 text-white"
            stroke="currentColor"
            fill="none"
            viewBox="0 0 24 24"
          >
            <path
              stroke-linecap="round"
              stroke-linejoin="round"
              stroke-width="2"
              d="M6 18L18 6M6 6l12 12"
            />
          </svg>
        </button>
      </div>
    </div>
  </div>
</notification-container>

You can now call it from anywhere using:

<template>
    <button type="button" @click="add({type: 'success', message: 'All good!'})">SHOW NOTIFICATION</button>
</template>
<script>
import { mapActions } from 'vuex';

export default {
  name: 'DemoComponent',
  setup() {
    const { add } = mapActions('notification', ['add']);

    return { add };
  },
};
</script>

Tests

You can execute tests by calling

npm run test:unit

Contributions

Contributions are welcome - please make sure all PRs have their associated test.