# zkt-svg

> zkt react svg icon component

Latest version **0.0.8** (published 2019-11-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install zkt-svg
pnpm add zkt-svg
yarn add zkt-svg
bun add zkt-svg
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2019-11-29 |
| First published | 2019-07-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 796.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jiang Fengbing |
| Maintainers | j. |
| Keywords | svg, icon, react-svg |

## Links

- npm: https://www.npmjs.com/package/zkt-svg
- Homepage: https://github.com/jiangfb/zkt-svg
- npm.io page: https://npm.io/package/zkt-svg

## Dependencies (1)

- [svg-sprite-loader](https://npm.io/package/svg-sprite-loader.md) ^3.8.0

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads
- [@react-md/material-icons](https://npm.io/package/@react-md/material-icons.md) — 1.6K weekly downloads

## Recent versions

- 0.0.8 (latest) — 2019-11-29
- 0.0.6 — 2019-11-20
- 0.0.5 — 2019-07-18
- 0.0.4 — 2019-07-18
- 0.0.3 — 2019-07-18
- 0.0.2 — 2019-07-18
- 0.0.1 — 2019-07-18

## README

### zkt-svg

This is a simple react component that can easily use SVG files;Base on svg-sprite-loader module;

### Usage

##### index.jsx

```javascript
import React, { Component } from 'react';
import ZktSvg from 'zkt-svg'

export default class Index extends Component {
 render() {
  return (
   <div>
	<ZktSvg className='someClass' svgName='smile' />
	{/* 
	 The svgName value should be same as the svg file name 
	*/}
   </div>
 )}
}
```


##### webpack.config.js

```javascript
module: {
 rules: [
  { 
    test: /\.jsx?$/,
     use: [
	 'babel-loader',
	 'zkt-svg/loader'
     ]
  }]
/* 
  The default directory of svg files is ./src/images; 
  Your project's folder tree should be like this:

 *-src
 * --images
 *  ---smile.svg
 *-webpack.config.js
  
*/
  
 Or customize the directory 
...
  { 
   test: /\.jsx?$/,
   use: [
	'babel-loader',
	{
	  loader:'zkt-svg/loader',
	  options: { directory: path.resolve(__dirname, 'folder1/folder2/svgs') }
	}
  ]}
... 

```

```html
<!-- Output -->

<svg class="">
 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#smile">
  #shadow-root (closed)
 </use>
</svg>

```

---
_Source: https://npm.io/package/zkt-svg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
