https://github.com/chmln/note.js
Elegant, lightweight notification library
https://github.com/chmln/note.js
Last synced: 11 months ago
JSON representation
Elegant, lightweight notification library
- Host: GitHub
- URL: https://github.com/chmln/note.js
- Owner: chmln
- Created: 2016-11-06T20:27:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-23T17:57:55.000Z (over 8 years ago)
- Last Synced: 2025-03-18T08:53:26.877Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://chmln.github.io/Note.js
- Size: 135 KB
- Stars: 25
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Note.js
Elegant, lightweight & simple notification library.


**Why another notification library?**
Existing js notification libraries are either:
* Forcing you to load jQuery, Bootstrap, or something else totally unnecessary
* ~~Ugly~~
* Specific to a certain framework
* Painful to use with bundlers, such as Webpack
Note.js is:
* **Lightweight** - `< 2kb` js+css
* **Framework-agnostic** (use it in React, Angular, Vue, or in plain HTML/JS environment)
* Compatible with **IE10+** and all major browsers
### Getting Started
`npm install Note.js --save` or [download](https://github.com/chmln/Note.js/releases) a release
```js
// Start by creating an instance. Overriding default config is optional
const note = new Note({}); // Note
```
Then,
```js
note.success(title, text, config);
note.info(title, text, config);
note.error(title, text, config);
note.warn(title, text, config);
note.notify(title, text, config); // colorless
```
You can customize the duration, and make the notification sticky.
```js
note.success("Success!", "But I'm not going anywhere..yet", { sticky: true });
note.info("Hey!", "I'm leaving in 5 seconds", { duration: 5 });
```