0.4.6 • Published 1 year ago

svelte-icomoon v0.4.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Svelte-Icomoon Logo

npm License

It makes it very simple to use SVG icons in your Svelte projects.

demo - svgps.app

Install

npm install svelte-icomoon
yarn add svelte-icomoon

Usage

You can use svgps.app to access over 40,000 free icons and convert your own icons into selection.json.

Or you can use IcoMoon to generate the selection.json file.

Declare

// Icon.svelte
<script>
  import Icomoon from "svelte-icomoon";
  import iconSet from "./selection.json";
</script>

<Icomoon iconSet="{iconSet}" {...$$props} />

Use

<script>
  import Icon from "./Icon.svelte";
</script>

<Icon name="pencil" size="{30}" color="blue" />

Props List

NameTypeDefaultSample
iconSetObject-"selection.json file content"
nameString-"home"
sizeNumber,String-"1em", 10, "100px"
colorString-"red", "#f00", "rgb(0,0,0)"
styleObject{...}{ color: '#ff0'}
titleString-"Icon Title"
disableFillBoolean-true
removeInlineStyleBoolean-true

Default Style

{
  display: "inline-block",
  stroke: "currentColor",
  fill: "currentColor",
}

Related Links

0.4.5

1 year ago

0.4.6

1 year ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.4.4

2 years ago

0.4.1

2 years ago

0.2.3

2 years ago

0.4.0

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.2.4

2 years ago

0.1.2

3 years ago

0.0.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago