stephane-monnot / react-vertical-timeline

Vertical timeline for React.js
https://stephane-monnot.github.io/react-vertical-timeline/
MIT License
1.07k stars 158 forks source link

Icon #7

Closed jadelmir closed 6 years ago

jadelmir commented 6 years ago

what is the right way to add an Icon?

stephane-monnot commented 6 years ago

You can find an example with material-ui-icons here : https://github.com/stephane-monnot/resume/blob/master/src/components/ResumeWorkAndEducationBlock/ResumeWorkAndEducationBlock.js

import WorkIcon from 'material-ui-icons/Work';
...
<VerticalTimelineElement
  ...
  icon={<WorkIcon />}
  iconStyle={{background: '#2196f3', color: '#fff'}}
  ...
>
  ...
</VerticalTimelineElement>
...
luishgranja commented 4 years ago

what is the right way to add an Icon?

It looks like the icon prop requires an icon element, either from '@material-ui/icons/' or for example from FontAwesome like this: icon={<i className='fa fa-map'> </i>} or any other react or html component, another example here. Hope this helps.