vue-ionicon
v2.1.1
Published
Caching asynchronous IonIcons loader for Vue
Downloads
11
Readme
vue-ionicon
Caching icon loader with an emphasis for loading the Ionicons directly from the CDN.
Demo
https://www.velis.si/ion-icon/
Features
- Renders sanitised SVG
- Loads from Ionicons CDN, any local URL, any full URL or SVG literal
- Caches loaded icons, there will be only one HTTP request per icon
- Applies currentColor to icons: if colour is not otherwise specified, icons will have same color as HTML text
Installing
.. code-block:: bash
npm install --save vue-ionicon
Using
.. code-block:: html
<!-- will load from your own server or any other if full URL is provided -->
<IonIcon name="/images/my-custom-icon.svg"/>
<!-- will display the provided SVG, but with all processing (sanitizing, applying currentColor) -->
<IonIcon :name="<svg...mySvgLiteral</svg>"/>
</div>
.. code-block:: javascript
Credits
Vue <https://vuejs.org>
_ The Progressive JavaScript FrameworkIonicons <https://github.com/ionic-team/ionicons>
_ projectDOMPurify <https://github.com/cure53/DOMPurify>
_ project