Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andreruffert/snackbar
π« Lightweight feedback notifications
https://github.com/andreruffert/snackbar
javascript notifications
Last synced: about 1 month ago
JSON representation
π« Lightweight feedback notifications
- Host: GitHub
- URL: https://github.com/andreruffert/snackbar
- Owner: andreruffert
- License: mit
- Created: 2015-11-20T11:26:11.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T11:08:14.000Z (almost 2 years ago)
- Last Synced: 2024-11-05T09:04:58.664Z (about 2 months ago)
- Topics: javascript, notifications
- Language: JavaScript
- Homepage: https://andreruffert.github.io/snackbar
- Size: 555 KB
- Stars: 21
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# snackbar
[![npm version](https://img.shields.io/npm/v/snackbar.svg)](https://www.npmjs.com/package/snackbar)
[![npm downloads](https://img.shields.io/npm/dm/snackbar?logo=npm)](https://www.npmjs.com/package/snackbar)> Lightweight feedback notifications
## Install
```
$ npm install --save snackbar
```## Usage
1. First of all make sure to import the [snackbar.scss](https://github.com/andreruffert/snackbar/blob/master/src/snackbar.scss) file into your project.
2. Use the snackbar.js API
```js
const snackbar = require('snackbar');// Optional configuration
snackbar.duration = 5000;
snackbar.gap = 250;// Show the snackbar or add it to the queue
snackbar.show('Ohai!');
```## API
### snackbar.show(message)
#### message
Type `string`
### snackbar.duration
Time to show snackbar before hiding (default 5000)
Type `number`
### snackbar.gap
Time between sequential snackbars (default 250)
Type `number`
## License
MIT Β© [AndrΓ© Ruffert](http://andreruffert.com)