Skip to content
Snippets Groups Projects
Commit 93edfae5 authored by Alf Eaton's avatar Alf Eaton
Browse files

Add Icon, using react-feather

closes #23
parent 8e4d1789
No related branches found
No related tags found
No related merge requests found
......@@ -10,9 +10,11 @@
"jsnext:main": "src",
"dependencies": {
"classnames": "^2.2.5",
"humps": "^2.0.1",
"prop-types": "^15.5.10",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-feather": "^1.0.7",
"react-redux": "^5.0.6",
"react-router": "^3.0.5",
"react-tag-autocomplete": "^5.4.1",
......
import React from 'react'
import { pascalize } from 'humps'
import * as icons from 'react-feather'
const Icon = ({ children, color = 'black', size = 24 }) => {
// convert `arrow_left` to `ArrowLeft`
const name = pascalize(children)
// select the icon
const icon = icons[name]
return (
<span>{icon({ color, size })}</span>
)
}
export default Icon
An icon, from the [Feather](https://feathericons.com/) icon set.
```js
<Icon>arrow_right</Icon>
```
The color can be changed.
```js
<Icon color="red">arrow_right</Icon>
```
The size can be changed.
```js
<Icon size={48}>arrow_right</Icon>
```
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment