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 not centered #105

Closed alexroumi closed 2 years ago

alexroumi commented 3 years ago

In the timeline the icons are not centered.

image

kwiznix commented 3 years ago

How did you put an image? my images wont show up..

payapula commented 3 years ago

@kwiznix We can pass it in icon prop for VerticalTimelineElement.

If this doesn't help please create a codesandbox reproduction and let us investigate the issue.

kwiznix commented 3 years ago

I tried to use my custom icon and couldnt get them to work, now trying with fontawesome icons, and seems to work great, but I have the same issue, the images arent centered

payapula commented 3 years ago

Hmm. I think you could make it center aligned with css by passing styles to IconStyle prop, or you can directly style the class vertical-timeline-element-icon. This package is not doing anything special with the alignment of icons, so CSS should help us here.

In any case, a repro would help us reproduce the problem :)

ertemishakk commented 2 years ago
 <VerticalTimelineElement
         className="vertical-timeline-element--work"
         contentStyle={{ background: 'whitesmoke', color: 'black' }}
         contentArrowStyle={{ borderRight: '7px solid  whitesmoke' }}
         iconStyle={{ background: 'whitesmoke', color: '#485fee' }}
         icon={<div className='text-center'><i style={{ lineHeight: '60px', fontSize: 18 }} className="fas fa-tag"></i></div>}
>

</VerticalTimelineElement>

Try the icon above