better-react-spinkit icon indicating copy to clipboard operation
better-react-spinkit copied to clipboard

Unable to center the Circle

Open gregturn opened this issue 8 years ago • 4 comments

Plugging in a <Circle /> into my web app, it aligns left.

Appears the only place where I can get it to center is if I put "margin:auto;" in the <div style="..."> element when exploring with Chrome.

Unfortunately, that is completely inaccessible through the API. Is this something that could be extended, allowing custom bits of CSS or classes to be injecting?

gregturn avatar Feb 28 '17 18:02 gregturn

I was able to center the spinners by wrapping them inside a div with this style:

display: flex;
justify-content: center;

rvanmil avatar Mar 22 '17 12:03 rvanmil

But why there not working just <Circle style={{margin: "0 auto"}}? It's common practice in React, as far as i know.

Amareis avatar Jul 24 '17 17:07 Amareis

@Amareis, you're right. This should support style props. I'll work it into the next release.

rawgroundbeef avatar Jul 24 '17 17:07 rawgroundbeef

An example of the code that allowed me to center the spinner was as follows (I was using FoldingCube and borrowed the idea from @rvanmil above):

<div className="loader"> <FoldingCube size={100} color='#7DA1BF'/> </div>

CSS: .loader { position: absolute; top: calc(50% - 4em); left: calc(50% - 4em); width: 6em; height: 6em; }

Thanks for considering adding it as a style prop in a future release @bentatum :)

MRMTC avatar Apr 07 '18 12:04 MRMTC