Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/datlyfe/svg-web-component
- Owner: Datlyfe
- Created: 2019-12-15T15:13:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-15T15:30:17.000Z (about 5 years ago)
- Last Synced: 2024-11-29T08:44:31.126Z (about 1 month ago)
- Topics: javascript, svg, web-components
- Language: JavaScript
- Homepage:
- Size: 59.6 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```