JSFiddle - React, Tailwind, and code Playground

HTML

<div class="container">
  <div class="spinner"></div>
</div>

CSS

.container {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.spinner {
  display: inline-block;
  width: 80px;
  height: 80px;
}

.spinner::after {
  content: ' ';
  display: block;
  width: 64px;
  height: 64px;
  margin: 8px;
  border-radius: 50%;
  border: 8px solid;
  border-color: #f00 transparent;
  animation: rotate-spinner 1.2s linear infinite;
}

@keyframes rotate-spinner {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadein {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}