qwik-emoji
Why?
Emojis can add a light playfulness to your project but require some specific formatting in order to ensure they are accessible for all users. qwik-emoji
's reusable Emoji
component helps you do that quickly and painlessly.
Installation
Add qwik-emoji
to your project:
npm install qwik-emoji
# or
yarn add qwik-emoji
Use
Import Emoji
, a default export, from qwik-emoji
and add it to your code:
import Emoji from "qwik-emoji";
export default component$(() => {
return (
<div>
<Emoji symbol="👋" label="Hello" />
Qwik
<Emoji symbol="⚡️" />
</div>
);
});
Emoji component
The Emoji
component consumes two props: symbol
and label
. Every other prop is spread to the top-level <span>
element.