1.0.2 • Published 4 years ago

@si-components/svelte v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@si-components/svelte

simple-icons component for Svelte

Installation

npm i @si-components/svelte simple-icons

simple-icons must be installed as a peer dependency. You must also preprocess your svelte files because this package uses <script lang="ts">.

Usage

<script>
  import SIIcon from '@si-components/svelte'
  // import icon from simple-icons
  import svelteIcon from 'simple-icons/icons/svelte'
</script>

<!-- pass icon into component -->
<SIIcon icon={svelteIcon} />

<!-- pass width, height, and color -->
<SIIcon icon={svelteIcon} width={100} height={100} color="#{svelteIcon.hex}" />

<!-- extra attributes are passed to svg -->
<SIIcon icon={svelteIcon} svgProps={{ stroke: '#00ff00', 'stroke-width': 2 }} />