crc442 / rc-actions

Reactions in React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  • Tidy code
  • Add tests

imcrc.me  ·  GitHub @crc442  · 

About

Reactions in React

License:MIT License


Languages

Language:JavaScript 75.2%Language:CSS 11.8%Language:Makefile 10.1%Language:HTML 2.9%