Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chemzqm/notice
A nice global message notice component
https://github.com/chemzqm/notice
Last synced: 6 days ago
JSON representation
A nice global message notice component
- Host: GitHub
- URL: https://github.com/chemzqm/notice
- Owner: chemzqm
- Created: 2014-04-19T12:18:10.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-22T05:11:19.000Z (almost 9 years ago)
- Last Synced: 2024-12-13T13:15:48.685Z (14 days ago)
- Language: JavaScript
- Size: 53.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# notice
A notification message component.
A fork with API rework from [yuehu/notice](https://github.com/yuehu/notice).
Showcase at .
## Installation
Install with [component(1)](http://component.io):
$ component install chemzqm/notice
## API
```js
var Notice = require('notice');
var notice = new Notice('show a notice', {
type: 'success',
duration: 4000
})
```### notice(msg, [option])
Show notice with `msg` (String or HTML) and optional option.
* `option.type` could be `success` (implies duration to be 2000) `warning` `error`.
* `option.duration` could be the millisecond to auto hide, no close button when set.
* `option.closable` whether the notice should be closable.
* `option.parent` parent node of the notice### .hide([ms])
Hide the message in `ms` millisecond, success notice implies auto hide.
### .remove()
Remove the message without animation.
## License
MIT