digitransit-ui/digitransit-component/packages/digitransit-component-icon/README.md
Joonas Rissanen 3b85ea6bc1 docs: readme
2020-05-18 09:32:03 +03:00

54 lines
1.4 KiB
Markdown

# @digitransit-component/digitransit-component-icon
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## Icon
Icon renders predefined Svg icons as react component.
### Parameters
- `$0` **[Object][1]**
- `$0.color`
- `$0.img`
- `$0.height`
- `$0.width`
- `$0.rotate`
### Examples
```javascript
<Icon
img="bus" // Key of svg, required
height={1} // Height as em, optional
width={1} // Width as em, optional
color="#007ac9" // Color of image, optional
rotate={90} // How many degrees to rotate image, optional
/>
```
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the digitransit-component project. -->
---
This module is part of the Digitransit-ui project. It is maintained in the
[HSLdevcom/digitransit-ui](https://github.com/HSLdevcom/digitransit-ui) repository, where you can create
PRs and issues.
### Installation
Install this module individually:
```sh
$ npm install @digitransit-component/digitransit-component-icon
```
Or install the digitransit-component module that includes it as a class:
```sh
$ npm install @digitransit-component/digitransit-component
```