npm.io
1.0.2 • Published 6 years ago

svelte-emoji

Licence
MIT
Version
1.0.2
Deps
0
Size
26 kB
Vulns
0
Weekly
0
Stars
7

svelte-emoji

npm npm bundle size (minified) npm

An accessible Emoji component for Svelte applications

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. svelte-emoji's reusable Emoji component helps you do that quickly and painlessly.

This component was ported to Svelte from a11y-react-emoji.

Installation

Add svelte-emoji to your project:

npm install svelte-emoji
# or
yarn add svelte-emoji

Use

Import Emoji, a default export, from svelte-emoji and add it to your code:

<script>
    import Emoji from `svelte-emoji`
</script>

<footer>
    Made with
    {' '}
    <Emoji symbol="💕" label="love" />
    {' '}
    by Sean McPherson
</footer>

Emoji component

The Emoji component consumes two props: symbol and label. Every other prop is spread to the top-level <span> element.

License

MIT

Keywords