Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
reactive-hermes
Advanced tools
A notification manager for react. Animated, customizable, light and cleaner, allows you to controll duration, sound, and even use other react components inside of messages.
Hermes is a notification message manager.
It deals with your messages in your page's interface.
It manages multiple messages at a time.
It's cleaner, ligher.
It allows you to use react components within the message, making it a powerfull tool.
It can be used to replace other messagers. Has a lighter, malleable design and animations.
You can even manage messages by id or simulate a loading controller.
Take a look.
See how to do this in the examples below.
Test it live, in the demo tool.
npm install --save reactive-hermes
You need to import and add the HermesComponent
to your interface.
You should do that once, let's say, in your root page for example.
// used only once
import { Hermes, HermesComponent } from 'reactive-hermes'
[...]
<HermesComponent />
Now, you can access the global Hermes
object, or import it in your modules and then use its API, described below.
// used anywhere
import { Hermes } from 'reactive-hermes'
// or
import Hermes from 'reactive-hermes'
[...]
Hermes.message('The message')
// or
window.Hermes.message('The message') // does not require to be imported
Let's see some of the cool things you can do with it!
You can send some props to enforce a default behavior:
(2) Page Title
.playAudio
attribute in the tag to use a default audio or pass a value to it with an Audio Object (to customize the audio).<HermesComponent
defaultDuration={999}
updateTitleCounter
playAudio={new Audio(...)}
animate />
These are methods you can access at Hermes
:
Hermes.message(String)
This is an easy way to show a message.
Hermes.message(Object)
This is the advanced way to show messages.
It accepts an object with:
default
, warn/warning
, error/fail
, info
or success
playAudio
attribute for this particular message. May be true/false
or an AudioObjectid
. May only be closed programaticallyHermes.updateMessage(Object)
Allows you to update an existing message. If the message is not opened, it will be shown.
The object must have an id
for the message to be updated.
Hermes.closeMessage(String/Number)
Closes an open message with the given id
Aliases work just like the methods, but using different default values.
Hermes.message
passing type 'info'.Hermes.message
passing type 'warn'.Hermes.message
passing type 'error'.Hermes.message
passing type 'success'.You can use this events in the one tag for the HermesComponent, so, the listener will be called everytime any message triggers the given event. Or you can pass the eventListener on each individual message to listen for only its event.
info
is shown.warn
is shown.error
is shown.success
is shown.Are you using methods like showWarning
and showSuccess
?
No problem, you can just import them from Hermes
too!
import { showerror, showSuccess } from 'reactive-hermes'
See some ways you can show messages
let message = 'You are the chosen one.';
Hermes.success(message);
Hermes.success(message, { /* other options */ });
Hermes.message({
type: 'success',
body: message
})
Result:
let message = 'You have been warned!';
Hermes.warn(message);
// show the warning, animating its icon
Hermes.warn(message, { animate: true });
Hermes.message({
type: 'warn',
body: message
})
Result:
let message = 'Something is out of order!';
Hermes.fail(message);
Hermes.error(message);
Hermes.error(message, { /* options */ });
Hermes.message({
type: 'error',
body: message
})
Result:
let message = 'Info messages, wohoo!!';
Hermes.info(message);
// show info and play audio
Hermes.info(message, { playAudio: true });
Hermes.message({
type: 'info',
body: message
})
Result:
let message = 'Yet another useless message';
Hermes.message({
body: message,
id: 'myMessageId',
locked: true
})
Result:
let message = 'Saving...';
Hermes.message({
body: message,
id: 'savingMsg',
locked: true,
animate: true
})
Then, some time later...
Hermes.updateMessage({
body: 'Saved',
id: 'savingMsg',
locked: true,
animate: false,
duration: 3 // 3 seconds
})
Result:
Hermes.message(<div>Content here :)</div>)
// or
Hermes.message({
// ...
body: <SomeComponent prop1={val} />
// ...
})
Result:
You can add changes to the following CSS selectors:
x
button in unlocked messages, to close themFeel free to contribute to this project by sending Pull Requests, reporting problems or even sending suggestions.
Just remember to follow the community terms/rules/good practices :)
Once you've cloned the project...
Install:
npm install
Start the server (this will also enable the live/hot reload for the component):
npm start
Make chages:
Work in the src/
files, or in the demos/src/
files, or in css/
files.
Build:
npm run build
Then push it and open a PR :)
FAQs
A notification manager for react. Animated, customizable, light and cleaner, allows you to controll duration, sound, and even use other react components inside of messages.
The npm package reactive-hermes receives a total of 0 weekly downloads. As such, reactive-hermes popularity was classified as not popular.
We found that reactive-hermes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.