Back to CSS Progress Bars Conic Ring Pure CSS
Share
HTML
<div
  class="pb-ring"
  role="progressbar"
  aria-valuenow="74"
  aria-valuemin="0"
  aria-valuemax="100"
  aria-label="Profile completion"
  style="--pb-ring-value: 74"
>
  <span class="pb-ring-track" aria-hidden="true"></span>
  <span class="pb-ring-meta">
    <strong>74<small>%</small></strong>
    <em>Profile</em>
  </span>
</div>
CSS
.pb-ring {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  --pb-ring-deg: calc(var(--pb-ring-value, 0) * 3.6deg);
  background: conic-gradient(
    #c084fc 0deg,
    #f472b6 var(--pb-ring-deg),
    rgba(255, 255, 255, 0.06) var(--pb-ring-deg),
    rgba(255, 255, 255, 0.06) 360deg
  );
  animation: pbRingDraw 1.4s cubic-bezier(0.5, 0, 0.3, 1.2) forwards;
  font-family: system-ui, sans-serif;
}

.pb-ring-track {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #15151d;
  box-shadow: inset 0 0 18px rgba(192, 132, 252, 0.15);
}

.pb-ring-meta {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1;
}

.pb-ring-meta strong {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: #f0eeff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
}

.pb-ring-meta strong small {
  font-size: 13px;
  font-weight: 600;
  color: #c084fc;
  margin-left: 1px;
}

.pb-ring-meta em {
  display: block;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a78bfa;
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .pb-ring {
    animation: none;
  }
}

@keyframes pbRingDraw {
  from { --pb-ring-deg: 0deg; }
  to   { --pb-ring-deg: calc(var(--pb-ring-value, 0) * 3.6deg); }
}