https://github.com/component/notification
growl-style notifications for the browser
https://github.com/component/notification
Last synced: 7 months ago
JSON representation
growl-style notifications for the browser
- Host: GitHub
- URL: https://github.com/component/notification
- Owner: component
- Created: 2012-06-22T00:29:17.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2015-07-21T18:44:30.000Z (over 10 years ago)
- Last Synced: 2025-08-15T03:45:25.991Z (8 months ago)
- Language: JavaScript
- Size: 226 KB
- Stars: 36
- Watchers: 9
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# Notification
Notification component with a clean slate to build off of,
style and position them however you like.

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([ms])
Hide the notification immediately or wait ms.
### 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