charkour / react-reactions

😲 Create custom reaction pickers and counters or use your favorites!
MIT License
74 stars 16 forks source link

custom reaction bar #62

Closed charkour closed 3 years ago

charkour commented 3 years ago

Add's the ability to use custom reactions on the reaction bar

image

Also works with images.

image

Useage:

Reaction Bar Selector

import React from 'react';
import { ReactionBarSelector } from '@charkour/react-reactions';

const Component = () => {
  return <ReactionBarSelector />;
};

Props:

iconSize?: number — String icon pixel size. Defaults to 38px reactions?: Reaction[]; — Array of Reaction objects {label: "haha", node: <div>😄</div>} to display. onSelect: (label: string) => void; — Function callback when emoji is selected

Note: When passing an <img> as a Reaction. Specify the iconSize as the height of the image. <img height={iconSize} src="img-source" />

github-actions[bot] commented 3 years ago

size-limit report 📦

Path Size
dist/react-reactions.cjs.production.min.js 53.8 KB (+0.47% 🔺)
dist/react-reactions.esm.js 53.88 KB (+0.48% 🔺)