digitransit-ui/digitransit-component/packages/digitransit-component-icon
2025-06-10 15:47:24 +03:00
..
src DT-6784 replacement bus icon for search, version bumps 2025-04-28 17:03:55 +03:00
index.js chore: in NODE_ENV=development, use dev bundles with included inline sourcemaps 2022-05-20 14:15:30 +03:00
LICENSE-AGPL.txt feat: add icon to digitransit-components 2020-05-15 16:42:38 +03:00
LICENSE-EUPL.txt feat: add icon to digitransit-components 2020-05-15 16:42:38 +03:00
package.json chore: update i18next to latest versionb which works without esm6 2025-05-21 18:37:05 +03:00
README.md docs: readme 2020-05-18 09:32:03 +03:00
test.js fix: import path 2020-08-21 10:10:15 +03:00

@digitransit-component/digitransit-component-icon

Icon

Icon renders predefined Svg icons as react component.

Parameters

  • $0 Object
    • $0.color
    • $0.img
    • $0.height
    • $0.width
    • $0.rotate

Examples

<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
/>

This module is part of the Digitransit-ui project. It is maintained in the HSLdevcom/digitransit-ui repository, where you can create PRs and issues.

Installation

Install this module individually:

$ npm install @digitransit-component/digitransit-component-icon

Or install the digitransit-component module that includes it as a class:

$ npm install @digitransit-component/digitransit-component