@novyk/sx-icon

$ ng add @novyk/sx-icon

Usage no npm install needed!

<script type="module">
  import novykSxIcon from 'https://cdn.skypack.dev/@novyk/sx-icon';
</script>

README

sx-icon

Angular SVG Icons Handler

Installation

$ ng add @novyk/sx-icon

Usage

Add icons to registry:

constructor(
  private iconsRegistry: SxIconsRegistry,
) {}
...
this.iconsRegistry.add({name: 'star', url: '/assets/icons/star.svg'});
// or
this.iconsRegistry.add([
  {name: 'star', url: '/assets/icons/star.svg'},
  {name: 'cloud', url: '/assets/icons/cloud.svg'},
  {name: 'home', xml: '<svg ...'}
]);

Use in a template:

<sx-icon name="star"></sx-icon>