Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@streammedev/hermes

Package Overview
Dependencies
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@streammedev/hermes

A composable React component for message composing with autocomplete and formatting

latest
Source
npmnpm
Version
2.1.2
Version published
Maintainers
4
Created
Source

Hermes

NPM Version NPM Downloads js-happiness-style

Messages like you have never seen them before

Hermes Example

Install

$ npm install --save @streammedev/hermes

Basic Usage

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'));

Options

Prop NameDefaultDescription
className"hermes"The container classname
placeholderundefinedPlaceholder 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
childrenundefinedChildren to add inside the container
autoFocusfalseAutofocus the field on render
value""The initial input value
formatValue""A function which formats the value display (see example)
preventNewLinesfalseWill prevent new lines in the input
suggestionsnullAn array of suggestions to show the user
loadSuggestionsundefinedA function to load suggestions
clearSuggestionsundefinedA function to clear the suggestions
renderSuggestionundefinedA function to custom render the suggestions items
getSuggestionTextidentity functionA function to get the suggestion text from the selected suggestion item
onSelectSuggestionundefinedA function to call when a suggestion is selected
onChangeValueundefinedA function to call when the value changes
storeundefinedA redux compatible store like @streammedev/flux-store

Example

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.

Advanced Usage

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.

Contributing

Contributions are welcome. Please see our guidelines in CONTRIBUTING.md

Keywords

message

FAQs

Package last updated on 03 Jan 2018

Did you know?

Socket

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.

Install

Related posts