modules/expo-emoji-picker/README.md
A native emoji picker module for React Native applications built with Expo. This module provides platform-specific emoji selection interfaces using native system components.
Based on react-native-emoji-popup and expo-emoji-picker.
The module exposes a React component that presents native emoji picker UI on iOS and Android. When a user selects an emoji, it fires a callback with the selected emoji string.
androidx.emoji2.emojipicker.EmojiPickerView componentThe module follows Expo's module architecture with three layers:
src/): React components and type definitionsios/): Swift implementation using MCEmojiPickerandroid/): Kotlin implementation using AndroidX emoji pickerOn iOS, the module creates an invisible tap target view. When tapped, it presents MCEmojiPicker as a modal view controller:
EmojiPickerView.swift: Custom view that handles tap gestures and presents the pickerEmojiPickerModule.swift: Module definition that registers the view with ExpoThe picker is presented from the current React view controller and returns the selected emoji via an event dispatcher.
On Android, the module embeds the AndroidX EmojiPickerView directly as a full-screen component:
EmojiPickerModuleView.kt: Wraps the system EmojiPickerView in an ExpoViewEmojiPickerModule.kt: Module definition that registers the view with ExpoThe AndroidX emoji picker provides a grid-based interface with category tabs and search.
The module uses platform-specific file extensions for different behaviors:
EmojiPicker.tsx (iOS): Renders an invisible tap target that accepts childrenEmojiPicker.android.tsx (Android): Renders the full emoji picker view with flex: 1 layoutBoth components normalize the native event structure to provide a consistent onEmojiSelected callback.
expo-module.config.json: Defines the module name and native class mappings for iOS and Androidindex.ts: Public exports for the modulesrc/EmojiPickerModule.ts: Native module registrationsrc/EmojiPickerModule.types.ts: TypeScript type definitionssrc/EmojiPickerView.tsx: Base native view componentsrc/EmojiPicker.tsx: iOS-specific implementationsrc/EmojiPicker.android.tsx: Android-specific implementationios/EmojiPickerModule.swift: Module definition (11 lines)ios/EmojiPickerView.swift: View implementation with tap handling and picker presentationios/EmojiPickerModule.podspec: CocoaPods specification with MCEmojiPicker dependencyandroid/src/main/java/expo/community/modules/emojipicker/EmojiPickerModule.kt: Module definitionandroid/src/main/java/expo/community/modules/emojipicker/EmojiPickerModuleView.kt: View implementationandroid/build.gradle: Gradle configuration with androidx.emoji2:emoji2-emojipicker dependencyimport { EmojiPicker } from 'expo-emoji-picker'
function MyComponent() {
const handleEmojiSelected = (emoji: string) => {
console.log('Selected emoji:', emoji)
}
return (
<EmojiPicker onEmojiSelected={handleEmojiSelected}>
</EmojiPicker>
)
}
No additional configuration is required. The module is automatically linked through Expo's autolinking system when the app is built.
The module definition in expo-module.config.json specifies the native class names for each platform, which Expo uses to register the module at runtime.