### Install emoji-store Package Source: https://github.com/codeabinash/emoji-store/blob/main/README.md Use npm to install the emoji-store package. This is the first step to using the library in your project. ```bash npm i emoji-store ``` -------------------------------- ### Platform Configuration Constants Source: https://context7.com/codeabinash/emoji-store/llms.txt Pre-built constants for common emoji styles (Apple and Facebook) in different sizes are exported for convenience. Custom configurations can also be created. ```APIDOC ## Platform Configuration Constants ### Description Provides pre-built constants for supported emoji styles and sizes, and allows for custom configurations. ### Constants - **`Apple64`**: `{ author: 'apple', size: 64, type: 'png' }` - **`Apple160`**: `{ author: 'apple', size: 160, type: 'png' }` - **`Facebook64`**: `{ author: 'facebook', size: 64, type: 'png' }` - **`Facebook96`**: `{ author: 'facebook', size: 96, type: 'png' }` ### Custom Configuration A custom configuration object can be provided with the same shape: `{ author: 'string', size: number, type: 'png' }`. ### Usage Example ```javascript import { Apple64, Apple160, Facebook64, Facebook96 } from 'emoji-store'; // Using pre-built constants console.log(Apple64); console.log(emoji('๐Ÿ˜€', Apple64)); // Using a custom configuration const customProps = { author: 'apple' as const, size: 160 as const, type: 'png' as const, }; console.log(emoji('๐Ÿซข', customProps)); const customEmoji = Emoji(customProps); console.log(customEmoji('๐Ÿง‘๐Ÿปโ€๐Ÿ’ป')); ``` ``` -------------------------------- ### Platform Configuration Constants and Customization Source: https://context7.com/codeabinash/emoji-store/llms.txt Utilize pre-built platform configuration constants (Apple64, Apple160, Facebook64, Facebook96) or define a custom configuration object with 'author', 'size', and 'type' properties for fine-grained control over emoji styles. ```ts import { Apple64, Apple160, Facebook64, Facebook96 } from 'emoji-store'; // Pre-built constants console.log(Apple64); // { author: 'apple', size: 64, type: 'png' } console.log(Apple160); // { author: 'apple', size: 160, type: 'png' } console.log(Facebook64); // { author: 'facebook', size: 64, type: 'png' } console.log(Facebook96); // { author: 'facebook', size: 96, type: 'png' } // Custom config object (same shape) const customProps = { author: 'apple' as const, size: 160 as const, type: 'png' as const, }; import emoji, { Emoji } from 'emoji-store'; console.log(emoji('๐Ÿซข', customProps)); // => "https://dataabinash.github.io/emoji/apple/png/160/emojis/1fae2.png" const customEmoji = Emoji(customProps); console.log(customEmoji('๐Ÿง‘๐Ÿปโ€๐Ÿ’ป')); // => "https://dataabinash.github.io/emoji/apple/png/160/emojis/1f9d1-1f3fb-200d-1f4bb.png" ``` -------------------------------- ### Use Emoji Component with Specific Configuration Source: https://github.com/codeabinash/emoji-store/blob/main/README.md Import the Emoji component and a specific emoji configuration like Facebook96. This allows for more controlled emoji rendering. ```tsx import { Emoji, Facebook96 } from 'emoji-store'; const customEmoji = Emoji(Facebook96); function App() { return (
); } ``` -------------------------------- ### Configure Custom Emoji Properties Source: https://github.com/codeabinash/emoji-store/blob/main/README.md Define custom properties such as author, size, and type to create a specific emoji configuration. Then, use this configuration with the Emoji function to render emojis. ```ts const props = { author: 'apple', size: 160, type: 'png', }; const customEmoji = Emoji(props); console.log(customEmoji('๐Ÿซข')); console.log(customEmoji('โค๏ธโ€๐Ÿ”ฅ')); console.log(customEmoji('๐Ÿ„๐Ÿปโ€โ™‚๏ธ')); console.log(customEmoji('๐Ÿง‘๐Ÿปโ€๐Ÿ’ป')); ``` -------------------------------- ### Create reusable emoji resolver with Emoji() factory Source: https://context7.com/codeabinash/emoji-store/llms.txt Use the Emoji() factory function to create a resolver bound to a specific platform configuration. This is useful for components or modules that consistently use the same emoji style, avoiding repetitive prop definitions. ```tsx import { Emoji, Apple160, Facebook64 } from 'emoji-store'; // Create a reusable resolver for Apple 160px const appleEmoji = Emoji(Apple160); console.log(appleEmoji('๐Ÿซข')); // => "https://dataabinash.github.io/emoji/apple/png/160/emojis/1fae2.png" console.log(appleEmoji('โค๏ธโ€๐Ÿ”ฅ')); // => "https://dataabinash.github.io/emoji/apple/png/160/emojis/2764-fe0f-200d-1f525.png" console.log(appleEmoji('๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ')); // => "https://dataabinash.github.io/emoji/apple/png/160/emojis/1f468-200d-1f469-200d-1f467-200d-1f466.png" // Create a separate Facebook 64px resolver const fbEmoji = Emoji(Facebook64); console.log(fbEmoji('๐Ÿ˜—')); // => "https://dataabinash.github.io/emoji/facebook/png/64/emojis/1f617.png" // Use in a React component with a consistent emoji style function EmojiList({ emojis }: { emojis: string[] }) { const render = Emoji(Apple160); return (
{emojis.map((e) => ( {e} ))}
); } ``` -------------------------------- ### Emoji(props?) โ€” Factory: reusable emoji resolver with fixed configuration Source: https://context7.com/codeabinash/emoji-store/llms.txt The `Emoji()` factory function creates a reusable resolver function bound to a specific platform configuration. This is useful for components that consistently use the same emoji style. ```APIDOC ## Emoji(props?) ### Description Creates a reusable emoji resolver function bound to a specific platform configuration. Avoids repeating the props object on every call. ### Method `Emoji(props?)` ### Parameters - **props** (object) - Required - Configuration object for platform and size. ### Returns - **function** - A resolver function that takes an emoji character and returns its image URL. ### Request Example ```javascript import { Emoji, Apple160, Facebook64 } from 'emoji-store'; // Create a reusable resolver for Apple 160px const appleEmoji = Emoji(Apple160); console.log(appleEmoji('๐Ÿซข')); // => "https://dataabinash.github.io/emoji/apple/png/160/emojis/1fae2.png" console.log(appleEmoji('โค๏ธโ€๐Ÿ”ฅ')); // => "https://dataabinash.github.io/emoji/apple/png/160/emojis/2764-fe0f-200d-1f525.png" // Create a separate Facebook 64px resolver const fbEmoji = Emoji(Facebook64); console.log(fbEmoji('๐Ÿ˜—')); // => "https://dataabinash.github.io/emoji/facebook/png/64/emojis/1f617.png" // Use in a React component with a consistent emoji style function EmojiList({ emojis }: { emojis: string[] }) { const render = Emoji(Apple160); return (
{emojis.map((e) => ( {e} ))}
); } ``` ``` -------------------------------- ### Generate single emoji URL with emoji() Source: https://context7.com/codeabinash/emoji-store/llms.txt Use the default emoji() function to generate a URL for a single emoji. It accepts an emoji character and an optional platform configuration. Defaults to '๐Ÿ˜€' with Apple 64px settings if no arguments are provided. ```tsx import emoji, { Apple64, Apple160, Facebook64, Facebook96 } from 'emoji-store'; // Default: Apple 64px console.log(emoji('๐Ÿ˜€')); // => "https://dataabinash.github.io/emoji/apple/png/64/emojis/1f600.png" // Apple 160px (high-res) console.log(emoji('โค๏ธโ€๐Ÿ”ฅ', Apple160)); // => "https://dataabinash.github.io/emoji/apple/png/160/emojis/2764-fe0f-200d-1f525.png" // Facebook 96px console.log(emoji('๐Ÿ˜—', Facebook96)); // => "https://dataabinash.github.io/emoji/facebook/png/96/emojis/1f617.png" // Use in React JSX function App() { return (
developer surfer
); } ``` -------------------------------- ### emoji(e?, props?) โ€” Default export: single emoji URL generator Source: https://context7.com/codeabinash/emoji-store/llms.txt The default `emoji()` function generates a URL for a given emoji character and an optional platform configuration. It defaults to '๐Ÿ˜€' with Apple 64px settings if no arguments are provided. ```APIDOC ## emoji(e?, props?) ### Description Generates a URL for a given emoji character and an optional platform configuration. Defaults to '๐Ÿ˜€' with Apple 64px settings. ### Method `emoji(e?, props?)` ### Parameters - **e** (string) - Optional - The emoji character to resolve. - **props** (object) - Optional - Configuration object for platform and size. ### Request Example ```javascript import emoji, { Apple64, Apple160, Facebook64, Facebook96 } from 'emoji-store'; // Default: Apple 64px console.log(emoji('๐Ÿ˜€')); // => "https://dataabinash.github.io/emoji/apple/png/64/emojis/1f600.png" // Apple 160px (high-res) console.log(emoji('โค๏ธโ€๐Ÿ”ฅ', Apple160)); // => "https://dataabinash.github.io/emoji/apple/png/160/emojis/2764-fe0f-200d-1f525.png" // Facebook 96px console.log(emoji('๐Ÿ˜—', Facebook96)); // => "https://dataabinash.github.io/emoji/facebook/png/96/emojis/1f617.png" // Use in React JSX function App() { return (
developer surfer
); } ``` ### Response - **string** - The URL of the hosted emoji image. ``` -------------------------------- ### Use Default and Custom Emojis in React Source: https://github.com/codeabinash/emoji-store/blob/main/README.md Import the emoji function and specific emoji constants to display emojis. The default emoji uses Apple64. You can also specify a different emoji size like Apple160. ```tsx import emoji, { Apple160 } from 'emoji-store'; function App() { return (
{/*Default Apple64*/}
); } export default App; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.