AI CSS Animations

Triangle Dots Loader

Three dots sit on the corners of a triangle and all slide to the next corner together, shrinking in transit and settling with a short hold. Reads as rotation, but every path is a straight edge.

Also known as: three dots triangle spinner, rotating triangle dots, tri dots loader.

HTML

<div class="ldr-triangle-dots" role="status" aria-label="Loading">
  <span></span><span></span><span></span>
</div>

CSS

.ldr-triangle-dots {
  --s: var(--ldr-size, 48px);
  --c: var(--ldr-color, #3b82f6);
  --d: calc(var(--s) / 4);
  --x: calc(var(--s) * 0.33);
  --y: calc(var(--s) * 0.285);
  position: relative;
  width: var(--s);
  height: var(--s);
}
.ldr-triangle-dots span {
  position: absolute;
  top: calc(50% - var(--d) / 2);
  left: calc(50% - var(--d) / 2);
  width: var(--d);
  height: var(--d);
  animation: ldr-triangle-dots-path 1.8s cubic-bezier(0.7, 0, 0.3, 1) infinite;
}
.ldr-triangle-dots span::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--c);
  animation: ldr-triangle-dots-size 0.6s ease-in-out infinite;
}
.ldr-triangle-dots span:nth-child(2),
.ldr-triangle-dots span:nth-child(2)::before { animation-delay: -0.6s; }
.ldr-triangle-dots span:nth-child(3),
.ldr-triangle-dots span:nth-child(3)::before { animation-delay: -1.2s; }
@keyframes ldr-triangle-dots-path {
  0%, 91.67%, 100% { transform: translate(0, calc(var(--y) * -1)); }
  25%, 33.33%      { transform: translate(var(--x), var(--y)); }
  58.33%, 66.67%   { transform: translate(calc(var(--x) * -1), var(--y)); }
}
@keyframes ldr-triangle-dots-size {
  0%, 75%, 100% { transform: scale(1); }
  37.5%         { transform: scale(0.6); }
}

@media (prefers-reduced-motion: reduce) {
  .ldr-triangle-dots, .ldr-triangle-dots *, .ldr-triangle-dots::before, .ldr-triangle-dots::after, .ldr-triangle-dots *::before, .ldr-triangle-dots *::after {
    animation-duration: 3s;
  }
}

Customizing this loader

  • Color: set --ldr-color on the element or a parent. Currently previewing #3b82f6.
  • Size: set --ldr-size. Every dimension in the snippet is derived from it. Currently previewing 64px.
  • Speed: change the duration on the animation shorthand. Delays on the children are relative, so they keep their rhythm.
  • Accessibility: the root carries role="status" and an aria-label so screen readers announce the wait. The reduced-motion rule at the end slows the animation for users who asked for less motion.

Similar loaders