Spiral Fan Stagger
rotate & scale
Radial blades rotated by calc(sibling-index() * 15deg) with staggered entrance.
sibling-index() Stagger Effects
Recreating all 6 visual stagger effects featured in the video! Pure CSS dynamic positional staggering without manual classes or JavaScript loops.
Items added dynamically automatically receive their correct stagger delay instantly!
Radial blades rotated by calc(sibling-index() * 15deg) with staggered entrance.
Vertical bars scaled via sibling index offset calculations forming a smooth bell curve wave.
Glowing dots with phase-shifted keyframe delays: calc(sibling-index() * -120ms).
Pill columns oscillating vertically with staggered timing offsets across the spectrum.
16-point circular geometry arranged via calc(sibling-index() * 22.5deg).
:nth-child() rules or writing JavaScript loops. With sibling-index(), it's 1 single line of pure CSS!
sibling-index()
A practical integration handbook. Discover the top production UI patterns where replacing JavaScript loops or repetitive :nth-child() CSS with sibling-index() dramatically simplifies your codebase.
When opening a mobile menu, command palette (Cmd+K), or sidebar, links slide in smoothly one after another.
When filtering product categories or loading blog search results, cards cascade onto the screen sequentially rather than appearing all at once.
Split headline text into individual letters or words for premium splash screen animations and landing page reveals.
style="--i: 1" attributes on every letter <span>!
When multiple alert toasts or system events arrive in rapid succession, each banner pops up smoothly with a tiny time gap.
Contextual action wheels, color palettes, or pie speed dials arranged evenly around a central hub using 360° circular angle math.
Positions dynamic floating buttons in a 360° fan layout around cursor/button coordinates.
Audio spectrum visualizers, financial sentiment bar graphs, and mathematical curves directly calculated in CSS without Canvas rendering.
Shifts wave phase timing backwards so all bars animate continuously in sync!
Evolution of stagger logic in web frontends
| Approach | Example Code | Pros | Cons |
|---|---|---|---|
| 1. Legacy CSS (:nth-child) |
li:nth-child(1) { delay: 100ms; } li:nth-child(2) { delay: 200ms; } ... |
Works everywhere | Requires writing 30+ repetitive CSS rules; breaks if list size changes. |
| 2. JavaScript Loop Binding |
items.forEach((el, i) => { el.style.animationDelay = `${i * 100}ms`; }); |
Dynamic list lengths | Requires JS execution, inline style clutter, potential layout reflows. |
| ✨ 3. Modern CSS sibling-index() |
li { animation-delay: calc(sibling-index() * 100ms); } |
1 line of pure CSS, zero JS, GPU-accelerated, dynamic DOM friendly. | Requires progressive fallback variable for legacy browsers. |