0.3.0 • Published 8 years ago

g-notifications v0.3.0

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

GNotifications

Dead Simple, Zero Dependency JS Notifications

Demo: https://realfresh.github.io/GNotifications/index

Sponsored by CloudWaitress - Online Food Ordering & Reservation System For Restaurants

Usage

1. Install

Via NPM : https://www.npmjs.com/package/g-notifications

npm install --save g-notifications

2. Import Stylesheet

Either user the css stylesheet from the "dist" directory or import the SASS file from the src folder

3. Import / Require In Code

var GN = require('g-notifications')
// or
import GN from 'g-notifications'

4. Use

GN.add({type:'success', message: 'Dead simple zero-dep JS notifications!', duration: 5000});
GN.add({type:'error', message: '<h2>Use custom HTML for the message</h2>', duration: 10000})
GN.add({type:'warning', message: 'Careful bro you might break something', duration: 6000, center:false});

API

GN.add({type, message, duration, center})

  1. type - success, error, warning
  2. message - string or HTML
  3. duration - millseconds
  4. center - true / false (center text, default is true)

GN.clear()

Clear all notifications

Position

GN.options.position = 'top';
GN.options.position = 'bottom';
0.3.0

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago