/react-emoji-ng

An emoji component for React

Primary LanguageTypeScript

react-emoji-ng

Build Status Coverage Status

simple emoji component for react

exports

import * as React from "react";
export declare enum EmojiType {
    TWITTER = 0,
    EMOJIONE = 1,
    SYMBOLS = 2,
}
export interface IReactEmojiProps {
    attrs?: React.HTMLAttributes<HTMLElement>;
    imgAttrs?: React.HTMLAttributes<HTMLImageElement>;
    svgAttrs?: React.SVGAttributes<SVGSVGElement>;
    children: string;
    symbolsUrl?: string;
    type?: EmojiType;
    tag?: string;
}
export declare const ReactEmoji: React.SFC<IReactEmojiProps>;

usage

<ReactEmoji>foo :smile: :(</ReactEmoji>

renders to

<div>
  {"foo "}
  <img
    width="20px"
    height="20px"
    src="https://twemoji.maxcdn.com/svg/1f604.svg"
  />
  {" "}
  <img
    width="20px"
    height="20px"
    src="https://twemoji.maxcdn.com/svg/1f61e.svg"
  />
</div>