
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@streammedev/hermes
Advanced tools
A composable React component for message composing with autocomplete and formatting
Messages like you have never seen them before
$ npm install --save @streammedev/hermes
var ReactDom = require('react-dom');
var Hermes = require('@streammedev/hermes');
ReactDom.render(<Hermes
autoFocus
placeHolder="Get your message across..."
suggestions={[/* your array of suggestions, updated when loadSuggestions is called */]}
loadSuggestions={function (term, fullText) {
// Get from your server,
// or whereever you get them,
// term is the current word
// fullText is the full input value
}}
clearSuggestions={function () {
// clear your suggestion list
}}
/>, document.getElementById('app'));
Prop Name | Default | Description |
---|---|---|
className | "hermes" | The container classname |
placeholder | undefined | Placeholder text to insert |
contentClassName | "hermes-content" | Classname for the contenteditable |
emptyClassName | "hermes-empty" | A classname added when the field is empty |
flyoutClassName | "" | A classname to add to the suggestions flyout |
flyoutElement | "ol" | A classname to add to the suggestions flyout |
children | undefined | Children to add inside the container |
autoFocus | false | Autofocus the field on render |
value | "" | The initial input value |
formatValue | "" | A function which formats the value display (see example) |
preventNewLines | false | Will prevent new lines in the input |
suggestions | null | An array of suggestions to show the user |
loadSuggestions | undefined | A function to load suggestions |
clearSuggestions | undefined | A function to clear the suggestions |
renderSuggestion | undefined | A function to custom render the suggestions items |
getSuggestionText | identity function | A function to get the suggestion text from the selected suggestion item |
onSelectSuggestion | undefined | A function to call when a suggestion is selected |
onChangeValue | undefined | A function to call when the value changes |
store | undefined | A redux compatible store like @streammedev/flux-store |
There is a working example, picutred in the gif above. Here is how to run it:
$ git clone git@github.com:StreamMeDev/hermes.git && cd hermes/examples/basic
$ npm install
$ node index.js
Then visit http://localhost:1337.
The package exposes all of the internal parts, so you can compose them together in your application however you like.
More to come on this.
Contributions are welcome. Please see our guidelines in CONTRIBUTING.md
FAQs
A composable React component for message composing with autocomplete and formatting
The npm package @streammedev/hermes receives a total of 2 weekly downloads. As such, @streammedev/hermes popularity was classified as not popular.
We found that @streammedev/hermes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.