New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

snackbarlightjs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snackbarlightjs

Easy snackbars without JQuery (Also supports vuejs)

latest
Source
npmnpm
Version
1.1.2
Version published
Weekly downloads
355
610%
Maintainers
1
Weekly downloads
 
Created
Source

SnackbarLightjs

Easy snackbars without JQuery (and its only 3kb minified!) Customize your snackbars or use the basic css file

Usage

Create snackbars with javascript

new Snackbar("Hey! Im a snackbar");
// Snackbar(message, options, callback)

or even easier write it right in your html

<span data-toggle=snackbar data-content="Hey! Im a snackbar">Click me</span>

Options

options: {
	// How long it takes for the snackbar to disappear
	timeout: 5000,
	// Wich class is used to tell that the snackbar is active
	activeClass: "active",
	// Name of the link or action if specified
	link: false,
	// If not specified clicking on the link will activate the callback if specified
	url: "#",
}

You can also specify these in your html

<span 
	data-toggle=snackbar 
	data-content="Hey! Im a snackbar"
	data-timeout=3000
	data-link="https://www.somePlaceFarAway.likeRealyFar/"
	data-active-class="active">
Click me</span>

Callbacks

You can attach a callback function for when the snackbar is clicked upon.

new Snackbar("Hey! Im a snackbar",{},function(){
	alert("Why did you have to close me!");
	});

Browserify

npm

var Snackbar = require("snackbarlightjs");

Snackbar.create("I can be used here also awesome!", {}, function(){});

Vuejs

This package does support usage in Vuejs npm

Basic usage:

this.$snackbar.create("Vuejs is awsome!", {}, function(){});

With Browserify

If you use Browserify to compile your vue you need to call Vue.use() on it

var Snackbar = require("snackbarlightjs");

Vue.use(Snackbar);

LICENSE

MIT

Keywords

snackbar

FAQs

Package last updated on 05 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts