Socket
Socket
Sign inDemoInstall

@svgmoji/twemoji

Package Overview
Dependencies
10
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @svgmoji/twemoji

The svgmoji sprites for the [`twemoji`](https://github.com/twitter/twemoji) library provided by Twitter.


Version published
Weekly downloads
28K
decreased by-14.26%
Maintainers
1
Install size
955 kB
Created
Weekly downloads
 

Readme

Source

@svgmoji/twemoji

The svgmoji sprites for the twemoji library provided by Twitter.


Version Weekly Downloads Bundled size Typed Codebase MIT License


Installation

# yarn
yarn add @svgmoji/twemoji

# pnpm
pnpm add @svgmoji/twemoji

# npm
npm install @svgmoji/twemoji

Usage

The following code creates an image with a src applied from the cdn. The first it is used it loads the sprite of all the emojis.

import { Twemoji } from '@svgmoji/twemoji';
import data from 'svgmoji/emoji.json';

const twemoji = new Twemoji({ data, type: 'all' });
const image = document.createElement('img');
image.src = twemoji.url('❤️');

document.body.append(image);

html

thumbs up   grinning   red heart   face with tears of joy   grinning face with sweat   pleading face   pile of poo   loudly crying face   smiling face with sunglasses   face screaming in fear

<!-- Individual -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/twemoji@2.0.0/svg/1F44D.svg"
  alt="thumbs up"
  title="thumbs up"
/>

<!-- Subgroup Bundle 12KB  -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/twemoji@2.0.0/sprites/subgroups/face-affection.svg#1F385"
/>

<!-- Grouped Bundle 182KB -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/twemoji@2.0.0/sprites/group/smileys-emotion.svg#1F441-FE0F-200D-1F5E8-FE0F"
/>

<!-- Full Sprite Bundle 7.3MB -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/twemoji@2.0.0/sprites/all.svg#1F441-FE0F-200D-1F5E8-FE0F"
/>

Keywords

FAQs

Last updated on 15 Jun 2021

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