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

vue-jackbox

v0.1.13

Published

A small vue plugin to display nice looking alerts

Readme

vue-jackbox

Requirements

Installation

# npm
$ npm install vue-jackbox

# yarn
$ yarn add vue-jackbox

Try it

API

Available methods inside a VueJS component

The same parameters apply to all the methods in $alert expect the method hide and clearDefault

Parameter | Type |Default| Description --------- | ---- | ------|----------- title | HTML/string | empty | The dialog title message | HTML/string | empty | The dialog message question | HTML/string | empty | The dialog question placeholder | string | empty | Input placeholder for prompt value | string | empty | Input value for prompt label | HTML/string | empty | Input label for prompt centerButtons | boolean | false | Center action buttons in dialog footer cancelOnBackdrop | boolean | false | Cancel dialog on backdrop click showBackdrop | boolean | true | Option to display backdrop cancelOnEsc | boolean | true | Cancel dialog on esc duration | number | -1 | The duration for which the alert will be shown, -1 = infinite ok | object | {text: 'Continue', action: null} | Text and callback on ok button. cancel | object | {text: 'Cancel', action: null} | Text and callback on cancel button. state | string | information | Sets color on dialog, options: information, critical, warning ,success buttons | string[] | ['cancel', 'ok'] | Select which buttons to show, you can add a custom button, but you will also need to add property for that. icon | HTML/String | ! | What icon to display, can me svg, text or img tag

Adding custom buttons

this.$alert({
  title: 'This is an test alert',
  message: 'I´m just testing',
  retry: { text: 'Retry', className: 'jb-dialog__button--action', action: () => { this.doRetry(); } },
  buttons: ['cancel', 'retry', 'ok'],
})

If any of the values is not present on the method call then the default values will be used.

All dialogs use the same code in the background, so all options are always available, the diffrent methods are just short hands. (Except for the prompt, that is the only one that supports the input.)

Show an alert

this.$alert({
  title: 'This is an test alert',
  message: 'I´m just testing'
})

Show an confirm

this.$confirm({
  title: 'Unsaved changes',
  message: 'You have made changes that are not yet saved, if you continue these will get lost.',
  question: 'Do you want to discard changes and continue?',
  state: 'critical',
  ok: {
    action: () => { this.$emit('close'); },
  },
});

Show an prompt

this.$prompt({
  title: 'Change name',
  message: 'Enter the new first name',
  placeholder: 'Enter first name',
  value: this.firstName,
  ok: {
    action: (value) => { this.firstName = value; }
  }
})

Show an notification

this.$alert({
  title: 'Name changed!',
  message: `Your name has successfully been changed to <strong>${this.firstName}</strong>`,
  state: 'success'
})

Usage

main.js

import Vue from 'vue'
import VueJackBox from 'vue-jackbox'
import App from './App'

Vue.use(VueJackBox)

And import stylesheets manually:

import 'vue-jackbox/dist/vue-jackbox.css';

App.vue

<template>
    <div id="app"></div>
</template>

<script>

export default {
  mounted () {
    this.$notification(
        {
          title: 'App loaded',
          text: 'The app has loaded successfully!',
          state: 'success'
        });
  }
}
</script>

<style>
</style>

License

The MIT License