rc-actions

1.0.3 • Public • Published

rc-actions npm

Reactions in React.

Use facebook's reactions like tooltip to do your own actions.

Install

$ npm install --save rc-actions

Use

Demo from the example folder.

Array of actions.

const images = [
      {id: 'like', description: 'Like', img: 'http://i.imgur.com/LwCYmcM.gif'},
      {id: 'love', description: 'Love', img: 'http://i.imgur.com/k5jMsaH.gif'},
      {id: 'haha', description: 'Haha', img: 'http://i.imgur.com/f93vCxM.gif'},
      {id: 'yay', description: 'Yay', img: 'http://i.imgur.com/a44ke8c.gif'},
];

Your element on which reactions need to be mounted.

render() {
		<button>Actions</button>
}

import and add reactions

import Reactions from 'rc-actions'
... 
render () {
	<Reactions items={images}>
		<button>Actions</button>
    </Reactions> 
}

Look at the example for more details.

Develop

Build:

$ make build

Start dev server:

$ make start

Todos

  • [ ] Add tests

imcrc.me  ·  GitHub @crc442  · 

Package Sidebar

Install

npm i rc-actions

Weekly Downloads

0

Version

1.0.3

License

MIT

Last publish

Collaborators

  • crc442