https://github.com/steebchen/smackbar
a simple jquery notification library plugin
https://github.com/steebchen/smackbar
Last synced: 4 months ago
JSON representation
a simple jquery notification library plugin
- Host: GitHub
- URL: https://github.com/steebchen/smackbar
- Owner: steebchen
- License: mit
- Created: 2016-09-30T15:55:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-08-03T02:39:03.000Z (almost 6 years ago)
- Last Synced: 2024-12-31T01:29:02.479Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# smackbar
a simple jquery notification library plugin
**DISCLAIMER: this library is still in development**
the name comes from the word snackbar which describes the message style from
Google's material design mixed with the project's only dependency
[smiler](https://github.com/steebchen/smiler) to transpile files
### setup
Method 1: CDN (**recommended**)
```html
```
Method 2: compile it by yourself (fully customizable)
```
git clone https://github.com/steebchen/smackbar && cd smackbar
npm i
npm start # compiles all files to the ./public/ directory. edit app.js to customize behavior
```
Method 3: get from npm
```
npm i smackbar
```
### usage
#### simple
This simple example shows a smackbar with a close button. It gets automatically
dismissed after 4 seconds.
```js
$.smackbar({
message: 'hi'
})
```
#### all options
```js
$.smackbar({
message: 'hi', // this is the only required field
timeout: 5000, // sepcify time in ms after the smackbar closes. set to false or 0 to disable
button: {
text: 'Undo', // the button text, will be transformed into uppercase automatically
preventClose: boolean, // TODO
onclick: function() {
console.log('clicked the button')
}
},
onclose: function() {
console.log('this function gets called when the smackbar gets closed')
}
})
```