CSS Reflow vs Composite Performance Demo

Interactive comparison showing why CSS transforms outperform layout-triggering properties

Number of balls:
Toggle Groups:

How it works:

Visualizing Repaints:

Testing Performance:

Code Examples:

Reflow Animation (Group A):

@keyframes moveLeftRight {
      0% {
        left: 0;
      }
      100% {
        left: calc(var(--container-width) - var(--circle-size));
      }
    }

Composite Animation (Group B):

@keyframes transformMove {
      0% {
        transform: translateX(0);
      }
      100% {
        transform: translateX(calc(var(--container-width) - var(--circle-size)));
      }
    }