Awesome SVG icon component for Svelte JS, built with Font Awesome icons. Based on [Justineo/vue-awesome][vue-awesome]
Svelte-Awesome is built upon [Font-Awesome][font-awesome] v4.7.0
This version adapts the original svelte-awesome
library to not import all the icons at once, to save space in your browser bundle. This means you need to import the icons individually and use the data=
attribute.
$ npm install --save @beyonk/svelte-awesome
import Icon from '@beyonk/svelte-awesome/src/components/Icon.html'
import beer from '@beyonk/svelte-awesome/src/icons/beer'
export default {
data () {
return {
beer
}
},
components: {
Icon
}
}
<!-- basic -->
<Icon data="{beer}"></Icon>
<!-- with options -->
<Icon data="{refresh}" scale="2"></Icon>
<Icon data="{comment}" flip="horizontal"></Icon>
<Icon data="{code-fork}" label="Forked Repository"></Icon>
<!-- stacked icons [WIP] -->
<Icon label="No Photos">
<Icon data="{camera}"></Icon>
<Icon data="{ban}" scale="2" class="alert"></Icon>
</Icon>