0.6.1 • Published 1 year ago

vue-icomoon v0.6.1

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

Vue-Icomoon Logo

npm npm License

📦 Zero Dependencies

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

Demo - Buy Me a Coffee

Install

npm install vue-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.vue

<template>
  <icomoon :iconSet="iconSet" v-bind="$props" />
</template>

<script>
  import { Icomoon } from "vue-icomoon";
  import iconSet from "./selection.json";

  export default {
    name: "Icon",
    components: { Icomoon },
    setup() {
      return {
        iconSet,
      };
    },
  };
</script>

Use

<template>
  <icon name="camera" :size="50" color="#5096ec" />
</template>

<script>
  import Icon from "./components/Icon/Icon.vue";

  export default {
    components: { Icon },
  };
</script>

Props List

NameTypeDefaultSample
iconSetObjectundefined"selection.json file content"
nameStringundefined"home"
sizeNumber,Stringundefined"1em", 10, "100px"
colorStringundefined"red", "#f00", "rgb(0,0,0)"
styleObject{...}{ color: '#ff0'}
titleStringundefined"Icon Title"
classStringundefined"icomoon"
disableFillBooleanundefinedtrue
removeInitialStyleBooleanundefinedtrue

iconList

You can use the iconList method to see a complete list of icons you can use.

import { iconList } from "vue-icomoon";
import iconSet from "./selection.json";

iconList(iconSet);

// sample output
[
  "document",
  "camera",
  "genius",
  "chat",
  "heart1",
  "alarmclock",
  "star-full",
  "heart",
  "play3",
  "pause2",
  "bin1",
];

Related Links

0.6.1

1 year ago

0.5.0

2 years ago

0.6.0

2 years ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.1

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.3

3 years ago

0.0.1

3 years ago