Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/datlyfe/svg-web-component

A custom web component for rendering svg
https://github.com/datlyfe/svg-web-component

javascript svg web-components

Last synced: about 1 month ago
JSON representation

A custom web component for rendering svg

Awesome Lists containing this project

README

        

# svg-web-component

A custom web component for rendering svg icons.

## Instalation

### NPM

```shell
npm install svg-web-component
(or)
yarn add svg-web-component
```

Add your svg data by calling the load function which takes an object where the key is the icon name and the value is the svg source,

```javascript
import svgWebComponent from "svg-web-component";
svgWebComponent.load({
plus:
''
});
```

### Browser

```html

SvgWebComponent.default.load({
plus:
'<svg viewBox="0 0 24 24"><path d="M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"/></svg>'
});

```

## Usage

```html

```