https://github.com/edwinwong90/react-native-icomoon
React Native Icommon
https://github.com/edwinwong90/react-native-icomoon
icomoon icon react react-native
Last synced: 3 months ago
JSON representation
React Native Icommon
- Host: GitHub
- URL: https://github.com/edwinwong90/react-native-icomoon
- Owner: edwinwong90
- License: mit
- Created: 2020-10-25T14:05:39.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-13T13:19:53.000Z (over 5 years ago)
- Last Synced: 2024-08-10T06:53:12.082Z (almost 2 years ago)
- Topics: icomoon, icon, react, react-native
- Language: Java
- Homepage:
- Size: 396 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-icomoon
React Native Icommon
## Installation
React Native Icomoon is using react-native-svg to render icon. Make sure install it correctly [https://github.com/react-native-svg/react-native-svg#installation](https://github.com/react-native-svg/react-native-svg#installation)
```sh
npm install react-native-icomoon react-native-svg
```
or
```sh
yarn add react-native-icomoon react-native-svg
```
## Usage
#### Create re-useable component
```js
import Icomoon from "react-native-icomoon"
import type { IconMoonProps } from 'react-native-icomoon'
import json from './selection.json'
type IconProps = Omit
export default function Icon({ name, ...restProps }: IconProps) {
return
}
```
#### Use
```js
import Icon from './Icon'
```
#### iconList
You can use the iconList method to see a complete list of icons you can use.
```js
import { iconList } from "react-icomoon";
import json from './selection.json'
iconList(json);
// sample output
[
"document",
"camera",
"genius",
"chat",
//...
]
```
## Props List
| Name | Type | Default | Sample |
|-------------------|---------------|-----------|-------------------------------|
| iconSet | Object | undefined | "selection.json file content" |
| name | String | undefined | "home" |
| size | Number,String | undefined | "1em", 10, "100px" |
| color | String | undefined | "red", "#f00", "rgb(0,0,0)" |
## License
MIT