feedback.js
Emit simple custom feedback messages.
Install
Get it using npm.
npm install feedback.js --save
CSS
You can usxe the css by directly importing the mains.css
from the dist folder.
@import "../node_modules/feedback.js/dist/main.css";
Usage
Check out live demo.
Feedback.emit(options)
options
Type: object
options.message
Type: string
Default: Unknown error.
Feedback message to be displayed
options.status
Type: string
Default: error
error
or success
, it stands for the class that will be added in the feedback element.
options.delay
Type: number
Default: it calculates the readtime by 4 words per second
Delay between the feedback entering and leaving the screen. This option is extremely optional, sice it automaticaly calculates the time at 4 words per second, but you can pass a custom number in milisseconds.
Example
Feedback.emit({
message: 'Something went wrong. Please wait.',
status: 'error'
});
Queue feature
feedback.js has the Queue feature, that allows you to emit how many messages you want, and they will be displayed one by one.
TODO
License
MIT