Skip to main content

Modal Mode

The library gives you the possibility to choose from two modes: modal or static. This section refers to the modal mode (for static mode, see static section)

To apply the modal mode in your app, use a default import from rn-emoji-keyboard

import EmojiKeyboard from 'rn-emoji-keyboard'

Required​

Requiredopen​

Required props which indicates whether the modal should be displayed on the screen.

TypeDefault
booleanfalse

RequiredonClose​

Callback fired when the component is to be closed.

TypeDefault
() => voidundefined

RequiredonEmojiSelected​

Callback fired when the emoji is selected. The passed function expose an object with selected emoji data. It also returns alreadySelected boolean indicating whether pressed emoji is already selected or not (see selectedEmojis).

TypeDefault
(emoji: { emoji, name, slug, unicode_version, alreadySelected }) => voidundefined

Optional​

allowMultipleSelections​

Allow select multiple emoji without dismiss keyboard.

TypeDefault
booleanfalse

categoryPosition​

Allow to change the position of available emoji categories container.

TypeDefault
'floating' | 'top' | 'bottom'floating

categoryOrder​

Allow to change order of available emoji categories container.

TypeDefault
CategoryTypes[][]

defaultHeight​

Specify collapsed container height. It can be either a number in points or a string in a percentage of the screen.

TypeDefault
number | string40%

disabledCategories​

Allow to hide specific categories by passing an array with their slugs.

TypeDefault
CategoryTypes[][]

disableSafeArea​

Allow to disable SafeAreaView inside the emoji keyboard.

tip

Look into React Native documentation for more details about SafeAreaView.

TypeDefault
booleanfalse

emojisByCategory​

Set of emojis that can be displayed in the app. You can pass your own emojis set or use the one that we have prepared.

info

Read more about Emojis Data

import { emojisByCategory } from 'rn-emoji-keyboard'
TypeDefault
EmojisByCategory[]emojisByCategory

emojiSize​

Set size of the single emoji.

TypeDefault
number28

enableRecentlyUsed​

Reveal extra category with recently used emojis.

TypeDefault
booleanfalse

enableSearchBar​

Reveal the search bar, used to find specific emoji.

TypeDefault
booleanfalse

hideSearchBarClearIcon​

Hide the search bar clear icon inside the search input.

TypeDefault
booleanfalse

customButtons​

Inject custom buttons into the component.

TypeDefault
React.ReactNodenull

enableCategoryChangeAnimation​

Allow to turn off FlatList scrolling animation when category is changed. Setting this to false will also overwrite enableSearchAnimation value.

TypeDefault
booleantrue

enableCategoryChangeGesture​

Allow to use horizontal swipe gesture to change emoji category

TypeDefault
booleantrue

enableSearchAnimation​

Allow to turn off FlatList scrolling animation when search results are updated.

TypeDefault
booleantrue

expandable​

Show knob and enable expand on swipe up.

TypeDefault
booleantrue

expandedHeight​

Specify expanded container height. It can be either a number in points or a string in a percentage of the screen.

caution

expandedHeight works only if expandable props is set to true.

TypeDefault
number | string80%

hideHeader​

Hide labels with category names.

TypeDefault
booleanfalse

onCategoryChangeFailed​

Callback fired when the category change failed.

TypeDefault
( info: {index, highestMeasuredFrameIndex, averageItemLength} ) => voidwarn(info)

onRequestClose​

Callback fired when emoji keyboard is closing.

TypeDefault
() => voidundefined

selectedEmojis​

Array of currently selected emojis. It must contain emoji's name.

TypeDefault
emoji.name[]undefined

styles​

Change styles of every component.

tip

Look into styles for more details.

theme​

Change colors of the components and text.

tip

Look into theme for more details.

translation​

Change the library language.

tip

Look into internationalization section for more details about translations.

TypeDefault
CategoryTranslationen