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

https://github.com/acrool/acrool-react-iconsvg

react icon component by svg symbols
https://github.com/acrool/acrool-react-iconsvg

icon icon-symbols react

Last synced: about 1 month ago
JSON representation

react icon component by svg symbols

Awesome Lists containing this project

README

        

# Acrool React IconSvg


Acrool React IconSvg Logo


This is the element using svg symbol as icon in React

[![NPM](https://img.shields.io/npm/v/@acrool/react-iconsvg.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-iconsvg)
[![npm](https://img.shields.io/bundlejs/size/@acrool/react-iconsvg?style=for-the-badge)](https://github.com/acrool/react-iconsvg/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/l/@acrool/react-iconsvg?style=for-the-badge)](https://github.com/acrool/acrool-react-iconsvg/blob/main/LICENSE)

[![npm downloads](https://img.shields.io/npm/dm/@acrool/react-iconsvg.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-iconsvg)
[![npm](https://img.shields.io/npm/dt/@acrool/react-iconsvg.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-iconsvg)

## Features

- Through the React component method, you can easily use the icon and change the size and color by specifying the Icon code.
- Use Icon Symbols to support multi-color Icon
- Support Nextjs 14+

## Install

```bash
yarn add @acrool/react-iconsvg
```

## Usage

add in your main.tsx

```ts
import '@acrool/react-iconsvg/dist/index.css';
```

> if you need `@acrool/react-iconsvg`, use rwd size setting,
add custom icon component in your project, copy [IconComponent](./example/src/library/acrool-react-icon/Icon.tsx) files.

## add Svg Symbols file `src/library/acrool-react-icon/SvgSymbols.tsx`

```tsx
const SvgSymbol = (





);
export default SvgSymbol;
```

in your App.tsx

```tsx
import {SvgSymbol} from '@/library/acrool-react-icon';

const App = () => {
return




{SvgSymbol} {/* <~ add this */}
;
}
```

## Use Sample

```tsx

window.alert('click!')}/>
```

## Tools
[acrool-icon-symbols](https://github.com/acrool/acrool-icon-symbols) - svgs build icon-symbols

## Online Manager
[acrool](https://docs.acrool.com/icon/manage-icon-symbol) - Project management system, providing icon management tools

There is also a example that you can play with it:

[![Play react-editext-example](https://raw.githubusercontent.com/acrool/acrool-react-iconsvg/main/play-in-example-button.svg)](https://acrool-react-iconsvg.pages.dev)

## License

MIT © [Acrool](https://github.com/acrool) & [Imagine](https://github.com/imagine10255)