# j-SVGIcons

> This component registers a new Web component in the form <ui-svgicon name='iconname'></ui-svgicon>.

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: 1f8677cd1bf4affcf17b4ca89470f42a558aacd0e22d60732439682916846bf2
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

This component registers a new Web component in the form `<ui-svgicon name="icon_name"></ui-svgicon>`.

- Use SVG sprites generator <https://svgsprit.es/>

__Configuration__:

- `url {String}` a URL address to the SVG file (default: `empty`)
- `size {Number}` a default image width (default: `empty`)

__Attributes `<ui-svgicon>`:__

- `name {String}` optional, icon name
- `size {Number}` optional, a size of image (default: `config.size`)
- `selected {String}` optional, selected icon name (it will be displayed if the parent element will contain `.selected` class)

Use it with `<ui-component name="svgicons">`. When the component is not loaded yet, jComponent downloads it on first use from the address in `DEF.fallback` (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

```html example.html
<ui-component name="svgicons" config="url:/svgicons.svg;size:30"></ui-component>

<div class="padding">
	<ui-svgicon name="phone"></ui-svgicon>
	<ui-svgicon name="phone"></ui-svgicon>
	<ui-svgicon name="phone" size="50"></ui-svgicon>
	<span class="toggle">
		<ui-svgicon name="profile" selected="profilefull"></ui-svgicon>
	</span>
</div>

<script>

	setInterval(function() {
		$('.toggle').tclass('selected');
	}, 1500);

</script>
```
