A custom hook that add's a random emoji in the title of a React title. NPM link
npm install random-title-emoji
import { useEmojiTitle } from 'random-title-emoji';
const App = () => {
let custom = ['🍏', '🍎', '🍐'];
return (
<div>
{useEmojiTitle({
category: 'smileys',
timeInterval: 2000,
limit: 10,
customGroup: custom
})}
</div>
);
};
export default App;
-
category
- The category of emojis you would like to be displayed in the title. ('animalAndNature', 'foodAndDrinks', 'smileys', 'everydayObjects', 'travelAndPlaces'). Default is 'animalAndNature'. -
timeInterval
- Second parameter of the interval. How fast you want the emojis to change. -
title
- The title of your document. Default isdocument.title
. -
placeLast
- Places the emoji in the end of you title. Defualt is false. -
limit
- Limit how many emojis you want to randomly be shown. -
customGroup
- An array of icons you specify to loop through.
John Raptis