npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

emjr

v1.0.4

Published

Customizable React-based emoji picker

Downloads

7

Readme

🐵 Emjr

npm node deps tests coverage

A customizable React-based emoji picker.

📦 Installation

# With npm:
npm i --save emjr

# With yarn:
yarn emjr

🐦 Components

Selector

import Selector from 'emjr';

<Selector set="twitter" />
<Selector onClick={emoji => console.log(emoji.name)} />
<Selector style={{position: 'absolute', top: 100, left: 100}} />
<Selector skin={2} autoFocus={true} />
<Selector phrases={{search: "Buscar", noMatch: "Aucun émoji ne correspond à votre recherche"}} />>

| Prop | Type | Default | Description | | :-----------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------: | :---------- | | set | {String} | twitter | The emoji set: apple, google, twitter, emojione, messenger or facebook | | size | {Number} | 28 | The emoji width and height. Will get the closest sheet size automatically. | | perRow | {Number} | 9 | Number of emojis per row. This will affect the selector's width | | skin | {Number} | 1 | Default skin color: 1, 2, 3, 4, 5 or 6 | | native | {Boolean} | false | Renders the OS's native unicode emoji | | autoFocus | {Boolean} | false | Auto focus the search input when mounted | | phrases | {Object} | | An object containing localized strings | | lang | {String} | en | The selector's language. List of supported langs | | onClick | {Function} | | Params: (emoji) => {} | | imageFn | {Function} | | A function that returns the image sheet to use for emojis. Useful for avoiding a request if you have a sheet locally. |

Emoji

import { Emoji } from 'emjr';

<Emoji emoji="joy" />
<Emoji emoji="red_car" set="google" size={64} />
<Emoji emoji="tomato" onClick={emoji => console.log("Yummy!")} />

| Prop | Type | Default | Description | | :---------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------: | :---------- | | emoji | {String} | | Either a string or an emoji object | | size | {Number} | 32 | The emoji width and height. Will get the closest sheet size automatically. | | set | {String} | twitter | The emoji set: apple, google, twitter, emojione, messenger or facebook | | skin | {Number} | 1 | Default skin color: 1, 2, 3, 4, 5 or 6 | | native | {Boolean} | false | Renders the OS's native unicode emoji | | imageFn | {Function} | | A function that returns the image sheet to use for emojis. Useful for avoiding a request if you have a sheet locally. | | onClick | {Function} | | Params: (emoji) => {} |

📐 Sheet sizes

The emoji spritesheets come from the emoji-datasource project and they are served through unpkg, a global CDN that serves NPM package files. Here's a list of the most used set and sheet sizes combos, although there are a lot more.

| Set | Sheet size (px) | Size | | -------- | --------------- | -------- | | apple | 16 | 938.7 kB | | apple | 20 | 1.3 MB | | apple | 32 | 2.6 MB | | apple | 64 | 7.2 MB | | emojione | 16 | 805.5 kB | | emojione | 20 | 1.1 MB | | emojione | 32 | 2.0 MB | | emojione | 64 | 2.7 MB | | google | 16 | 622.6 kB | | google | 20 | 849.8 kB | | google | 32 | 1.6 MB | | google | 64 | 3.6 MB | | twitter | 16 | 776.0 kB | | twitter | 20 | 1.0 MB | | twitter | 32 | 1.9 MB | | twitter | 64 | 4.2 MB |

🌍 Language and i18n

You can provide the lang prop with ISO 3166 supported country codes. The current supported langs are English (en) and Spanish (es). Please feel free to open a PR to add more languages.

You can also provide a phrases prop that follows the lang structure you can view in the langs.json file. Here's an example:

{
  "search": "Search",
  "noMatch": "No emoji matches your search"
}

😀 Emoji object

Most events such as onClick() will return an emoji object. Here's an example of the stuck_out_tongue emoji 😛:

{
  "name": "stuck_out_tongue",
  "char": "😛",
  "keywords": [
    "face",
    "prank",
    "childish",
    "playful",
    "mischievous",
    "smile",
    "tongue"
  ]
}

💯 Features

Awesome performance

We make use of shouldComponentUpdate() and functional components in a lot of places to lower the render times. Emjr will run perfectly on devices such as small laptops.

From XS to XL

Thanks to emoji-datasource you can choose to render your emojis from 16px up to 64px. We also take care of irregular sizes such as 28px by adding margin automatically.

Skin colors

You have control over which skin color is used by default, but it can be overwritten as per user preference.

Multiple sets supported

Apple, Google, Twitter, EmojiOne, Messenger and Facebook are supported.

Emoji sets

Unopinionated

We make no assumptions on where you're going to use the Selector component, and as so, we provide a powerful onClick() function where you can insert the emoji code into a text input, insert it into a text...

It's up to you to mount/unmout and position the component. You can also use emoji.char to use the emoji.

🏓 TODOs

  • !! End skin selector up
  • ! More powerful search
  • ! Custon scrollbar (by using ::-webkit-scrollbar CSS selector)
  • ! Easy to customize CSS
  • !! Fix lag on search out
  • Add search and exit icon on input
  • !! Add tests

📖 License

Emjr is licensed under the MIT License.