Coder Social home page Coder Social logo

react-native-emoji's Introduction

React Native Emoji

Emoji as React Native component

<Emoji name="coffee" style={{fontSize: 50}} />

Installation

  1. Install package via npm:
npm install --save react-native-emoji
  1. Require in your project
import Emoji from 'react-native-emoji';

Component properties

  • name (String) - Emoji's name (full list)
    Note that dashes should be replaced with underscores, e.g. raising-hand becomes raising_hand.
  • All supported <Text /> properties, like style.

Credits

Based on node-emoji. Originally maintained by @jorilallo.

react-native-emoji's People

Contributors

alihamza avatar alwx avatar ericpkerr avatar eveningkid avatar jorilallo avatar michaelmerrilltest avatar moonrailgun avatar mwiley avatar niftylettuce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-emoji's Issues

how to choose different emojis of same type?

So the list has like 4 to 5 different emojis of same name. for example writing "rage" only gives me the first emoji which is the simple one. How can I get the other rage emojis?

Question about cross platform emojis

Hey there,

I'm wondering if the emojis are going to be displayed the same on both iOS/Android or will they fall back to the emoji provided in the respective platform?

How do we pick skin color?

As you know, person emojis have skin color option. I would like to use certain emojis with skin color option. Is that available? If not, would you consider adding that feature?

Some emojis are not supported by shortname

<Emoji name={'man-getting-massage'} />
<Emoji name={'man-getting-haircut'} />
<Emoji name={'woman-walking'} />
<Emoji name={'woman-running'} />
<Emoji name={'man_dancing'} />
<Emoji name={'man-golfing'} />
<Emoji name={'woman-golfing'} />
<Emoji name={'man-surfing'} />
<Emoji name={'woman-surfing'} />
<Emoji name={'man_rowing_boat'} />
<Emoji name={'man-swimming'} />
<Emoji name={'woman-swimming'} />
<Emoji name={'man-bouncing-ball'} />
<Emoji name={'woman-bouncing-ball'} />
<Emoji name={'man-lifting-weights'} />
<Emoji name={'woman-lifting-weights'} />
<Emoji name={'man-biking'} />
<Emoji name={'handball'} />
<Emoji name={'woman-playing-handball'} />
<Emoji name={'croissant'} />
<Emoji name={'pancakes'} />
<Emoji name={'bacon'} />
<Emoji name={'green_salad'} />
<Emoji name={'tumbler_glass'} />
<Emoji name={'musical_notes'} />
<Emoji name={'drum_with_drumsticks'} />

Update npm package

PR #1 addressed the issue of the missing new emojis, such as flag-br, flag-ar and scales; however, as the package has not been republished to npm, users still end up getting the outdated version.

The fix would simply involve running npm version patch followed by npm publish by anyone with access to the package in npm (I'm assuming only @jorilallo).

Not working on Android

Trying to get it to work with android but I just get a blank space. Is this supposed to support both platforms?

Svg Text support?

Thank you for sharing this!

We needed to use an emoji inside an SVG and Android was not positioning the emoji correctly.

I think the fix might be something like:

'use strict';

import React, { PureComponent } from 'react';
import { Text } from 'react-native';
import Svg from 'react-native-svg';
import PropTypes from 'prop-types';
import nodeEmoji from 'node-emoji';

const SvgText = Svg.Text;

export default class Emoji extends PureComponent {
  static propTypes = {
    name: PropTypes.string.isRequired,
    svg: PropTypes.bool,
    ...Text.propTypes
  };

  render() {
    const { name, svg, ...props } = this.props;
    const emoji = nodeEmoji.get(name);
    if (!svg) {
      return (<Text {...props}>{ emoji }</Text>);
    }
    return (<SvgText {...props}>{ emoji }</SvgText>);
  }
}

I can submit a PR if you'd like or feel free to make the change if you think it's useful. Thanks again for sharing your work! 🏅

Solved: Android Opacity

Posting here in case it saves someone in the community from a little grief.

I just solved an issue I faced where my emoji were appearing perfectly fine on iOS, but when displayed on Android they were not using full opacity even though I set the opacity: 1.0 in the style prop (against a dark-grey background).

The solution is to use color: '#000000' in the style prop for the Emoji itself.

(hat tip)

Hand emojies doesnt work on android.

For some reason alot of the hand emojis doesnt work on android, and keep showing the label you send in.

Fex, crossed_fingers, handshake.

Get the faces and people to work, but not the hands.

Im on RN 0.57.5

Pull Request?

Hi @EricPKerr,

I forked your Library and made some changes which are breaking backwards compatibility. You can see it here: https://github.com/alexkuttig/react-native-emoji

I added EmojiCompat on Android and added an export for an EmojiText, which basically is Text from 'react-native', but with EmojiCompat support on Android.

Do you want me to make a pull request or shall I publish a seperate npm package?

Best,
Alex

Android emoji don't appear (juste stay with :name_of_emoji:)

I install using npm i -S react-native-emoji

Even not asking I do a react-native link

My code is <Text>(bla bla bla <Emoji name="coffe"/>) bla bla bla</Text>

But keeps not working the result you can see below:

image

Someone has this same problem? Can help me?

Tks!

Question

How can I replace these emoji pics to my local resources?

Issue with importing

Once I add the line

import Emoji from 'react-native-emoji';

at the top of my file and reload the app on iOS, I start seeing an error:

Cannot read property 'string' of undefined

If I remove that import statement, the app builds and runs fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.