Code Monkey home page Code Monkey logo

notification's Introduction

Notification

Notification component with a clean slate to build off of, style and position them however you like.

js growl component

These don't have to look like growl style notifications, use your trusty friend CSS.

Installation

$ npm install notification-component

Features

  • events for composition
  • structural CSS letting you decide on style
  • transient notifications
  • transient closable notifications
  • sticky (implicitly closable) notifications
  • notification classes (info, warn, error)
  • fluent API

Events

  • close the notification is closed via the X
  • click the notification is clicked

API

notify(msg)

Notify with the given msg and no title. The notification will hide after 4 seconds by default.

notify(title, msg)

Notify with the given msg and title. The notification will hide after 4 seconds by default.

notify.info(title, [msg])

Same as notify()

notify.warn(title, [msg])

Same as notify() with a warn class for styling.

notify.error(title, [msg])

Same as notify() with a error class for styling.

Notification#sticky()

Make the notification sticky, aka it will not close automatically, and it will automatically be .closable().

Notification#show()

Show the notification.

Notification#hide()

Hide the notification.

Notification#closable()

Mark the notification as closable, adding an "X" so the user may explicitly close it.

Notification#effect(name)

One of the following effects, or define your own with class name:

  • slide
  • fade
  • scale

License

MIT

notification's People

Contributors

tj avatar ddo avatar swatinem avatar ianstormtaylor avatar dandv avatar jonathanong avatar kenany avatar defunctzombie avatar stephenmathieson avatar trevorgerhardt avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.