Socket
Socket
Sign inDemoInstall

react-twemoji

Package Overview
Dependencies
13
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-twemoji

A React wrapper for Twemoji


Version published
Weekly downloads
7.6K
decreased by-24.84%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-twemoji

A simple React wrapper for Twemoji. It calls twemoji.parse() to convert emoji characters to Twemoji images.

Install

yarn add react-twemoji

or, if you use npm,

npm install react-twemoji

Usage

Simply use it to wrap your emotional content. Set the options prop to pass options to twemoji.parse.

import Twemoji from 'react-twemoji';

<Twemoji options={{ className: 'twemoji' }}>
  <p>😂<span>😉</span></p>
</Twemoji>

It outputs the following HTML to DOM,

<div>
  <p>
    <img draggable="false" class="twemoji" alt="😂" src="https://twemoji.maxcdn.com/2/72x72/1f602.png">
    <span>
      <img draggable="false" class="twemoji" alt="😉" src="https://twemoji.maxcdn.com/2/72x72/1f609.png">
    </span>
  </p>
</div>

Props

NameTypeDefaultDescription
optionsobjectundefinedtwemoji.parse options.
noWrapperbooleanfalseWhen it is true, Twemoji will not render a wrapping element (with tag) to contain its children. Note that since twemoji.parse needs a DOM element reference, any direct pure text child of Twemoji is not parsed when noWrapper is true. E.g. foo in <Twemoji noWrapper={true}>foo<p>bar</p></Twemoji> is not parsed.
tagstringdivThe tag of the wrapping element. This option is ignored when noWrapper is true.

Run example

yarn run example

then open http://localhost:8080/

Development

Lint

yarn run lint

Test

yarn run test

Build

yarn run build

FAQs

Last updated on 25 Mar 2022

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc