Icon component
An icon component. The SVG information comes from a JSON object served by the assets service. Because of the way the SVG is served the component only supports the following SVG elements (more can be added as needed):
- path
- circle
- rect
Install
npm i @wtc-components/icon -S
Usage
Import it into your project
import { Icon, IconProps, IconType } from '../src/components/Icon'
Prop
<Icon
icon={'icon-name'}
color="blue"
strokeWidth="5"
size={Size.L}
isFill={true}
/>
Props
Prop | Description | Default |
---|---|---|
size | Exists in settings definition | Size.S |
icon | What icon to show | |
color | Color of the icon. This can either be a single color as a string or an object {fill: #000, stroke: #000} | #000 |
strokeWidth | Width of the stroke of the icon. | 4 |
isFill | Sets whether icon should fill parent. | false |