### Installing RN Emoji Keyboard with npm Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/start.md This command installs the `rn-emoji-keyboard` package using npm, the default package manager for Node.js. It adds the package to your project's dependencies, enabling its use within your application. ```sh npm install rn-emoji-keyboard ``` -------------------------------- ### Installing RN Emoji Keyboard with Yarn Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/start.md This command installs the `rn-emoji-keyboard` package using Yarn, a popular package manager for JavaScript. It adds the package to your project's dependencies, making it available for use in your application. ```sh yarn add rn-emoji-keyboard ``` -------------------------------- ### Installing Dependencies with Yarn Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/README.md This command installs all necessary project dependencies using Yarn. It should be run once after cloning the repository to set up the development environment. ```Shell $ yarn ``` -------------------------------- ### Basic Usage of RN Emoji Keyboard in React Native Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/start.md This snippet demonstrates the basic integration of the `EmojiPicker` component into a React Native application. It shows how to manage the picker's visibility using a state variable (`isOpen`), define a callback function (`handlePick`) to process selected emojis, and render the `EmojiPicker` component with necessary props like `onEmojiSelected`, `open`, and `onClose`. ```js import EmojiPicker, { type EmojiType } from 'rn-emoji-keyboard' export default function App() { const [isOpen, setIsOpen] = React.useState(false) const handlePick = (emojiObject: EmojiType) => { console.log(emojiObject) /* example emojiObject = { "emoji": "❤️", "name": "red heart", "slug": "red_heart", "unicode_version": "0.6", } */ } return setIsOpen(false)} /> } ``` -------------------------------- ### Starting Local Development Server with Yarn Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/README.md This command initiates a local development server and automatically opens the website in a browser. It supports live reloading, reflecting most code changes instantly without server restarts. ```Shell $ yarn start ``` -------------------------------- ### Running Example App (iOS/Android) with Yarn Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/CONTRIBUTING.md This command runs the example application on either an iOS or Android emulator/device. It allows developers to test changes made to the library's JavaScript code in real-time without requiring a full rebuild, facilitating rapid development and testing. ```sh yarn example ios or yarn example android ``` -------------------------------- ### Running React Native Example App - Shell Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/contributions/workflow.md These commands run the example application for the `rn-emoji-keyboard` project on either an iOS or Android simulator/device. They are used to test changes made to the library's JavaScript code during development, with changes automatically reflected. ```sh yarn example ios ``` ```sh yarn example android ``` -------------------------------- ### Installing rn-emoji-keyboard with Yarn Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/README.md This snippet demonstrates how to install the `rn-emoji-keyboard` package using the Yarn package manager. It adds the library as a dependency to your React Native project, making its components available for use. ```sh yarn add rn-emoji-keyboard ``` -------------------------------- ### Basic Usage of EmojiPicker in React Native Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/README.md This example shows how to integrate and use the `EmojiPicker` component from `rn-emoji-keyboard` in a React Native application. It demonstrates managing the picker's visibility using React's `useState` hook and passing necessary props like `onEmojiSelected`, `open`, and `onClose`. ```js import EmojiPicker from 'rn-emoji-keyboard' export default function App() { const [isOpen, setIsOpen] = React.useState(false) return setIsOpen(false)} /> } ``` -------------------------------- ### Initializing Static EmojiKeyboard in React Native Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/static.md This snippet demonstrates how to use the `EmojiKeyboard` component as a static emoji picker. No additional props are required for static display, but the `onEmojiSelected` prop is essential for handling emoji selection events. This setup is suitable when the emoji picker needs to be a continuously visible UI element. ```jsx import { EmojiKeyboard } from 'rn-emoji-keyboard'; const ExampleComponent = () => { // ... return } ``` -------------------------------- ### Enabling Recently Used Emojis in EmojiPicker (JSX) Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/recently.md This snippet demonstrates how to enable the 'Recently Used' emoji category in the `EmojiPicker` component by setting the `enableRecentlyUsed` prop. It shows the basic setup of the component with `open`, `onClose`, and `onEmojiSelected` props, and highlights the addition of `enableRecentlyUsed` to display a dedicated category for recently used emojis. ```jsx import EmojiPicker from 'rn-emoji-keyboard' const ExampleComponent = () => { // ... return ( ) } ``` -------------------------------- ### Implementing Dark Mode with Basic Theme in React Native Emoji Keyboard (JSX) Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/dark.md This snippet demonstrates how to apply a basic dark mode theme to the `EmojiPicker` component using the `theme` prop. It configures colors for the backdrop, knob, container, header, skin tones container, and category icons/containers to achieve a dark aesthetic. This setup provides a foundational dark theme without customizing search or custom button styles. ```jsx setIsModalOpen(false)} theme={{ backdrop: '#16161888', knob: '#766dfc', container: '#282829', header: '#fff', skinTonesContainer: '#252427', category: { icon: '#766dfc', iconActive: '#fff', container: '#252427', containerActive: '#766dfc', }, }} /> ``` -------------------------------- ### Implementing Custom Translations for rn-emoji-keyboard (TypeScript) Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/internationalization.md This example illustrates how to provide a custom translation object directly to the `translation` prop of the `rn-emoji-keyboard`. Users can define their own localized strings for each emoji category, offering full control over the displayed text. This method is useful for languages not pre-defined or for specific terminology adjustments. ```TypeScript translation={{ smileys_emotion: 'Smileys & Emotion', people_body: 'People & Body', animals_nature: 'Animals & Nature', food_drink: 'Food & Drink', travel_places: 'Travel & Places', activities: 'Activities', objects: 'Objects', symbols: 'Symbols', flags: 'Flags', }} ``` -------------------------------- ### Building Static Website Content with Yarn Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/README.md This command compiles the Docusaurus website into static content, placing the generated files in the `build` directory. The output can then be served by any static content hosting service. ```Shell $ yarn build ``` -------------------------------- ### Deploying Website via SSH with Yarn Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/README.md This command deploys the website using SSH for authentication. It's a convenient method for building and pushing the website to the `gh-pages` branch, especially when using GitHub Pages. ```Shell $ USE_SSH=true yarn deploy ``` -------------------------------- ### Initiating Release Process with Yarn Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/CONTRIBUTING.md This command is likely used to trigger the project's release process, which might include tasks such as version bumping, generating changelogs, and publishing packages. It's mentioned in the context of commit message conventions, implying it might be part of an automated release flow. ```sh yarn release ``` -------------------------------- ### Verifying Code Quality (TypeScript & ESLint) - Shell Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/contributions/workflow.md These commands execute TypeScript and ESLint checks to ensure the code adheres to quality standards and passes type verification and linting rules. Running these is a prerequisite before committing or submitting a pull request. ```sh yarn typescript ``` ```sh yarn lint ``` -------------------------------- ### Initializing EmojiPicker in React Native (JSX) Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/basic.md This snippet demonstrates the basic integration of the `EmojiPicker` component from the `rn-emoji-keyboard` library into a React Native functional component. It shows how to import the component and render it with essential props like `open` (to control visibility), `onClose` (for handling modal closure), and `onEmojiSelected` (for processing selected emojis). ```jsx import EmojiPicker from 'rn-emoji-keyboard' const ExampleComponent = () => { // ... return ( ) } ``` -------------------------------- ### Deploying Website without SSH using Yarn Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/README.md This command deploys the website without SSH, requiring the GitHub username to be specified. It's useful for building and pushing the website to the `gh-pages` branch, particularly for GitHub Pages hosting. ```Shell $ GIT_USER= yarn deploy ``` -------------------------------- ### Importing EmojiKeyboard for Modal Mode - TypeScript Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/api/modal.md This snippet demonstrates the default import of the `EmojiKeyboard` component from `rn-emoji-keyboard`. This import is essential for utilizing the library in modal mode, allowing the keyboard to be displayed as an overlay. ```TypeScript import EmojiKeyboard from 'rn-emoji-keyboard' ``` -------------------------------- ### Verifying TypeScript and ESLint Compliance with Yarn Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/CONTRIBUTING.md These commands are used to verify that the codebase adheres to TypeScript type checking and ESLint linting rules. Running these checks ensures code quality, consistency, and helps catch potential errors before committing changes, which is a prerequisite for pull requests. ```sh yarn typescript yarn lint ``` -------------------------------- ### Configuring Static EmojiPicker in React Native Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/static_modal.md This snippet demonstrates how to render the `EmojiPicker` component as a static modal by setting the `expandable` prop to `false`. This prevents the modal from being resized or expanded by the user, providing a fixed-size emoji selection interface. It requires the `rn-emoji-keyboard` package. ```jsx import EmojiPicker from 'rn-emoji-keyboard' const ExampleComponent = () => { // ... return ( ) } ``` -------------------------------- ### Importing EmojiKeyboard for Static Mode (TypeScript) Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/api/static.md This snippet demonstrates how to import the `EmojiKeyboard` component when using the library in static mode. It utilizes a named import from the `rn-emoji-keyboard` package, which is essential for embedding the keyboard directly into a React Native application's layout rather than as a modal overlay. ```TypeScript import { EmojiKeyboard } from 'rn-emoji-keyboard' ``` -------------------------------- ### Implementing Dark Mode with Comprehensive Theme in React Native Emoji Keyboard (JSX) Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/dark.md This snippet expands on the basic dark mode theme by showcasing all available `theme` properties for the `EmojiPicker` component. In addition to the basic elements, it includes styling for `customButton` (icon, pressed states, background) and `search` (text, placeholder, icon, background), providing a complete dark mode experience. This comprehensive configuration allows for full customization of the component's appearance. ```jsx setIsModalOpen(false)} theme={{ backdrop: '#16161888', knob: '#766dfc', container: '#282829', header: '#fff', skinTonesContainer: '#252427', category: { icon: '#766dfc', iconActive: '#fff', container: '#252427', containerActive: '#766dfc', }, customButton: { icon: '#766dfc', iconPressed: '#fff', background: '#252427', backgroundPressed: '#766dfc', }, search: { text: '#fff', placeholder: '#ffffff2c', icon: '#fff', background: '#00000011', }, }} /> ``` -------------------------------- ### Importing Default Emojis Data - TypeScript Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/api/modal.md This snippet illustrates how to import the `emojisByCategory` data set, which provides a pre-defined collection of emojis. This data can be passed to the `emojisByCategory` prop of the `EmojiKeyboard` component to customize the available emojis. ```TypeScript import { emojisByCategory } from 'rn-emoji-keyboard' ``` -------------------------------- ### Importing Emojis Data in TypeScript Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/api/emojisData.md This snippet demonstrates how to import the `emojisByCategory` constant from the `rn-emoji-keyboard` library. This constant provides access to a structured collection of all available emojis, categorized for easy use within applications. ```ts import { emojisByCategory } from 'rn-emoji-keyboard' ``` -------------------------------- ### Importing useRecentPicksPersistence Hook (TypeScript) Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/api/useRecentPicksPersistence.md This snippet demonstrates how to import the `useRecentPicksPersistence` hook from the `rn-emoji-keyboard` library. This hook is essential for enabling custom persistence of recently used emojis, requiring the `enableRecentlyUsed` prop to be active on the emoji keyboard component for its functionality to take effect. ```TypeScript import { useRecentPicksPersistence } from 'rn-emoji-keyboard' ``` -------------------------------- ### Implementing Custom Delete Button in EmojiPicker (React Native) Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/custom-buttons.mdx This snippet demonstrates how to integrate a `DeleteButton` into the `EmojiPicker` component using the `customButtons` prop. The `DeleteButton` is configured with an `onPress` handler to define its action, and custom styles are applied based on the button's pressed state. It also shows how to set icon colors for normal and active states. ```jsx import EmojiPicker from 'rn-emoji-keyboard' const ExampleComponent = () => { // ... return ( setIsModalOpen(false)} enableSearchBar customButtons={[ ({ backgroundColor: pressed ? '#000' : '#e1e1e1', padding: 10, borderRadius: 100, })} iconNormalColor="#000" iconActiveColor="#fff" />, ]} allowMultipleSelections categoryPosition="top" /> ) } ``` -------------------------------- ### Using Pre-defined Translations in rn-emoji-keyboard (TypeScript) Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/internationalization.md This snippet demonstrates how to import and apply a pre-defined language translation, such as Polish (`pl`), to the `rn-emoji-keyboard` component. The imported language object is assigned to the `translation` prop, enabling the keyboard to display category names in the specified language. ```TypeScript import { pl } from 'rn-emoji-keyboard' // ... translation = { pl } ``` -------------------------------- ### Enabling Search Bar in EmojiPicker (React Native) Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/search.md This snippet demonstrates how to integrate and enable the search bar functionality within the `EmojiPicker` component by setting the `enableSearchBar` prop. It also notes the `hideSearchBarClearIcon` prop for controlling the visibility of the search input's clear icon. ```jsx import EmojiPicker from 'rn-emoji-keyboard' const ExampleComponent = () => { // ... return ( ) } ``` -------------------------------- ### Adding Polish Translation to EmojiPicker (JSX) Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/translated.md This snippet demonstrates how to apply a specific language translation, such as Polish (pl), to the EmojiPicker component from rn-emoji-keyboard. It involves importing the language slug and passing it to the 'translation' prop to localize the emoji keyboard. ```JSX import EmojiPicker, { pl } from 'rn-emoji-keyboard' const ExampleComponent = () => { // ... return ( ) } ``` -------------------------------- ### Implementing Recent Emoji Persistence with useRecentPicksPersistence and AsyncStorage (TypeScript) Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/recently-persistance.md This snippet demonstrates how to use the `useRecentPicksPersistence` hook from `rn-emoji-keyboard` to enable persistent storage for recently selected emojis. It integrates with `@react-native-async-storage/async-storage` to save and retrieve the emoji state, using `initialization` to load data and `onStateChange` to save updates. ```tsx import { useRecentPicksPersistence } from 'rn-emoji-keyboard' import AsyncStorage from '@react-native-async-storage/async-storage' useRecentPicksPersistence({ initialization: () => AsyncStorage.getItem(STORAGE_KEY).then((item) => JSON.parse(item || '[]')), onStateChange: (next) => AsyncStorage.setItem(STORAGE_KEY, JSON.stringify(next)), }) ``` -------------------------------- ### Defining Emojis Data Structure in TypeScript Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/api/emojisData.md This TypeScript snippet defines the data structures used for emojis within the `rn-emoji-keyboard` library. It includes `EmojiType` for individual emoji properties and `EmojisByCategory` for grouping emojis by category, illustrating the expected format for custom emoji data. ```ts type EmojiType = { emoji: string // Visual representation of emoji name: string slug: string unicode_version: string toneEnabled: boolean alreadySelected?: boolean } type EmojisByCategory = { title: CategoryTypes data: JsonEmoji[] } const emojisByCategory: EmojisByCategory[] ``` -------------------------------- ### Defining English Category Translation Object in TypeScript Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/contributions/translations.md This TypeScript snippet illustrates the required structure for a CategoryTranslation object. It defines key-value pairs for various emoji categories and search functionality, serving as a template for creating new language-specific translation files. This object should be exported and saved in a dedicated language file (e.g., `en.ts`). ```TypeScript export const en: CategoryTranslation = { recently_used: 'Recently used', smileys_emotion: 'Smileys & Emotion', people_body: 'People & Body', animals_nature: 'Animals & Nature', food_drink: 'Food & Drink', travel_places: 'Travel & Places', activities: 'Activities', objects: 'Objects', symbols: 'Symbols', flags: 'Flags', search: 'Search', } export default en ``` -------------------------------- ### Filtering and Providing Custom Emojis to EmojiPicker (React Native) Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/emojis-data.md This snippet demonstrates how to create a custom emoji dataset by filtering the default `emojisByCategory` to include only emojis with a specific unicode version (e.g., 11). The `getCustomEmojis` function generates this filtered set, which is then passed to the `emojisByCategory` prop of the `EmojiPicker` component. It's crucial that the structure and category titles of the custom data match the library's expected types. ```jsx import EmojiPicker, { emojisByCategory } from 'rn-emoji-keyboard' import type { EmojisByCategory } from 'src/types' const getCustomEmojis = () => { const newEmojiSet: EmojisByCategory[] = [] for (const [, value] of Object.entries(emojisByCategory)) { const newData = value.data.filter((emoji) => parseFloat(emoji.v) === 11) newEmojiSet.push({ title: value.title, data: newData, }) } return newEmojiSet } const ExampleComponent = () => { // ... return ( ) } ``` -------------------------------- ### Implementing Selected Emojis with rn-emoji-keyboard in React Native Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/selected_emojis.md This snippet demonstrates how to integrate the `selectedEmojis` feature with the `rn-emoji-keyboard` component. It uses React's `useState` hook to maintain a list of `currentlySelectedEmojis` and updates this list within the `handleOnEmojiSelected` callback. The `alreadySelected` property of the `emoji` object is used to determine whether to add or remove the emoji from the selection. ```JSX import EmojiPicker, { type EmojiType } from 'rn-emoji-keyboard'; const ExampleComponent = () => { // ... const [currentlySelectedEmojis, setCurrentlySelectedEmojis] = useState([]) const handleOnEmojiSelected = (emoji: EmojiType) => { //..Your on select logic // Remove or add pressed emoji to the currently selected array if (emoji.alreadySelected) setCurrentlySelected((prev) => prev.filter((a) => a !== emoji.name)) else setCurrentlySelected((prev) => [...prev, emoji.name]) } return ( ) } ``` -------------------------------- ### Setting Emoji Category Position to Top in React Native Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/categories_position.md This snippet demonstrates how to configure the `EmojiPicker` component to display its category tabs at the top. It utilizes the `categoryPosition` prop set to "top". This requires the `rn-emoji-keyboard` library. ```jsx import EmojiPicker from 'rn-emoji-keyboard' const ExampleComponent = () => { // ... return ( ) } ``` -------------------------------- ### Setting Emoji Category Position to Bottom in React Native Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/categories_position.md This snippet illustrates how to configure the `EmojiPicker` component to display its category tabs at the bottom. It uses the `categoryPosition` prop set to "bottom". This requires the `rn-emoji-keyboard` library. ```jsx import EmojiPicker from 'rn-emoji-keyboard' const ExampleComponent = () => { // ... return ( ) } ``` -------------------------------- ### Disabling Specific Emoji Categories in React Native Source: https://github.com/thewidlarzgroup/rn-emoji-keyboard/blob/master/docs/docs/documentation/Examples/disabled.md This snippet demonstrates how to use the `disabledCategories` prop with the `EmojiPicker` component from `rn-emoji-keyboard`. By passing an array of category names (e.g., 'activities', 'flags'), you can prevent those categories from appearing in the emoji picker, customizing the user experience. This prop expects an array of strings, where each string is the name of a category to be disabled. ```jsx import EmojiPicker from 'rn-emoji-keyboard' const ExampleComponent = () => { // ... return ( ) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.