1 Star 0 Fork 0

zeng / react-native-emojikeyboard

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

React Native Emoji Board

npm version

React Native Emoji Board is a customizable component similar to native keyboard but only with emoji for both iOS and Android. You can use this component as a keyboard input or emoji picker.

Emoji Board

Installation

  1. yarn add react-native-emoji-board
  2. yarn add react-native-vector-icons if you don't have it
  3. yarn add @react-native-community/viewpager if you don't have it

Linking

>= 0.60 Autolinking will just do the job.

< 0.60

react-native link react-native-vector-icons

react-native link @react-native-community/viewpager

Props

Required Props

Prop Description type
onClick Call back function when you clciked on emoji function

Optional Props

Prop Description type default value
showBoard Show or hide Emoji board with animation boolean false
customEmoji See Custom Emoji array []
categories Default full categories from emoji-datasource array See defaultProps.categories
blackList Exclude emojis based on short_name array []
numRows Number of emoji rows to display per slide number 8
numCols Number of emoji columns to display per slide number 5
emojiSize Default emoji size number 24
tabBarPosition Default category nav position string 'bottom'
hideBackSpace Show or hide backspace icon boolean false
categoryDefautColor Default category icon color string '#aaa'
categoryHighlightColor Default category icon highlight color string '#000'
categoryIconSize Default category icon size string 20
containerStyle Main container style, same as Layout Props object {}
tabBarStyle Category bar style, same as Layout Props object {}
labelStyle Category label style, same as Text Props object {}
onRemove Call back function when backspace get clicked function null

If you want to support less category or modify the icon, here is the categories props:

Prop Description type
name Category name string
iconType Only support MaterialCommunityIcons and FontAwesome, you can use defined iconType string
icon Icon/Font name, you can find list from here string

Example Code

import EmojiBoard from 'react-native-emoji-board'

const App: () => React$Node = () => {
    const [show, setShow] = useState(false);
    const onClick = emoji => {
        console.log(emoji);
    };

    return (
        <>
            <StatusBar barStyle="dark-content" />
            <TouchableOpacity onPress={() => setShow(!show)}>
                <Text>click here</Text>
            </TouchableOpacity>
            <EmojiBoard showBoard={show} onClick={onClick} />
        </>
    );
};

Custom Emojis

Example:

const customEmojis = [
    {
        code: '🎅🏼',
        img: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/160/apple/237/father-christmas_1f385.png',
        name: 'santa',
        category: 'Smileys & Emotion',
        sort_order: 1,
        skins: [
            {
                img: 'https://github.githubassets.com/images/icons/emoji/octocat.png',
                name: 'octocat',
            }
        ]
        
    }
]
Prop Description type
code Native emoji(optional, fallback to image) string
img If you would like to have custom image instead, don't set code string
name Emoji/image name string
category Emoji category, need to match with what you have in categories props string
sort_order Sort order number
skins Skin support, same props with above array

Credit

Inspired by xiewang/react-native-emoticons

MIT License Copyright (c) 2017 Yi Zhou Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

react-native emoji keyboard 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/zengjie123/react-native-emojikeyboard.git
git@gitee.com:zengjie123/react-native-emojikeyboard.git
zengjie123
react-native-emojikeyboard
react-native-emojikeyboard
master

搜索帮助