question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with positioning the spinner in center.

See original GitHub issue

Do you want to request a feature or report a bug? No

If reporting a bug, what version of react-spinners are you currently using?

What is the current behavior? I want to position the spinner horizontally and vertically center inside <div className="col-sm-9 col-md-9"></div>. I tried both “text-align: center” and “text-center” but neither of them worked.

If the current behavior is a bug, please provide the steps to reproduce

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

58reactions
krlmazanikcommented, Mar 13, 2019

@Suguru-Tokuda Hello. Try this:

import { ClipLoader } from "react-spinners";
import React from "react";

const Spinner = props => {
 const style = {textAlign: 'center'};
  return (
    <div style={style}>
      <ClipLoader color={"#123abc"} loading={props.isFetching} />
    </div>
  );
};

export default Spinner;

If u want to position in the very middle of the screen, try this: const style = { position: "fixed", top: "50%", left: "50%", transform: "translate(-50%, -50%)" };

Hope this will help!

0reactions
Dominic2000codecommented, Oct 26, 2022

@krlmazanik thanks a lot, it worked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS: Position loading indicator in the center of the screen
Here is a solution using an overlay that inhibits along with material design spinner that you configure one time in your app and...
Read more >
lightning web component spinner position issue
Adding spinner in the center on a Div you need to make a position:relative of a parent div Tag in which spinner is...
Read more >
Aligning Spinner to the middle | Blazor Forums - Syncfusion
We have validated your reported query. The SfSpinner will be positioned, to the center of the target element where is it placed.
Read more >
Loading spinner using CSS | LoginRadius Blog
Since, it's a spinner and normally covers the whole page. The combination of "position: fixed" and bottom, top, left, right as 0 will...
Read more >
Spinners - Lightning Design System
To use the spinner in a component, the parent of the spinner should be set to position:relative . You can use the utility...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found