Staggered Reveal
交错入场
A group of items enters in order, with a short delay between neighboring items.
Where to use it
Reveal a feature grid or short list without losing the reading order. Keep the interval short and group only enough items to fit on one screen so users can read the whole group quickly.
Practical example
A four-step lesson overview shows Prepare, Sketch, Ink, and Review in reading order as the row comes into view. Brief gaps between the entrances make the teaching sequence apparent.
Also called
- Staggered Entrance
AI prompt
Add Staggered Reveal to [target group]. When the group enters view, animate items in DOM order with roughly 60ms between starts and a capped total delay. Use a short fade and small offset, and keep the layout and focus order stable. Show every item immediately with reduced motion.
Example code
Save the standalone HTML as a file and open it in your browser. It uses the same code as the preview.
View HTML
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Staggered Reveal</title>
<style>
:root {
color-scheme: dark;
--demo-bg: #171629;
--demo-ink: #f8f5ff;
--demo-accent: #b9a6ff;
--demo-muted: #bfbbd3;
font-family: system-ui, sans-serif;
color: var(--demo-ink);
background: var(--demo-bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input { font: inherit; }
.demo {
display: grid;
place-items: center;
align-content: center;
min-height: 100vh;
padding: 14px;
overflow: hidden;
background: radial-gradient(ellipse at 50% 24%, #28233f, var(--demo-bg) 78%);
}
.demo-button {
border: 1px solid #ffffff3d;
border-radius: 7px;
background: #ffffff12;
color: var(--demo-ink);
padding: 6px 11px;
font-size: 12px;
cursor: pointer;
}
:focus-visible {
outline: 2px solid var(--demo-accent);
outline-offset: 3px;
}
.demo-action {
padding: 7px 14px;
border: 1px solid #61577d;
border-radius: 999px;
color: #f7f3ff;
background: #322b47;
font: inherit;
font-size: 12px;
font-weight: 650;
cursor: pointer;
}
.demo-action:hover { background: #413657; }
.stagger-scene { display: grid; justify-items: center; gap: 10px; width: min(100%, 172px); }
.stagger-rows { display: grid; gap: 5px; width: 100%; padding: 0; margin: 0; list-style: none; }
.stagger-rows li {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 10px;
color: #f2e9ff;
background: #332747;
border: 1px solid #57466e;
border-radius: 6px;
font-size: 11px;
}
.stagger-rows i { width: 8px; height: 8px; border-radius: 3px; background: #bdacff; }
.stagger-rows li:nth-child(2) i { background: #f4b495; }
.stagger-rows li:nth-child(3) i { background: #9ce2bd; }
</style>
</head>
<body>
<main class="demo">
<div class="stagger-scene">
<ul class="stagger-rows">
<li><i aria-hidden="true"></i>Color samples</li><li><i aria-hidden="true"></i>Icon grid</li><li><i aria-hidden="true"></i>Layout study</li>
</ul>
<button class="demo-action stagger-play" type="button">Play sequence</button>
</div>
</main>
<script>
const play = document.querySelector(".stagger-play");
const rows = document.querySelectorAll(".stagger-rows li");
const reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
let animations = [];
function resetAnimations() {
animations.forEach((animation) => animation.cancel());
animations = [];
}
reduceMotion.addEventListener("change", resetAnimations);
play.addEventListener("click", () => {
resetAnimations();
if (reduceMotion.matches || !Element.prototype.animate) return;
animations = Array.from(rows, (row, index) => row.animate(
[
{ opacity: 0.15, transform: "translateX(-12px)" },
{ opacity: 1, transform: "translateX(0)" },
],
{ duration: 360, delay: index * 115, fill: "backwards", easing: "ease-out" }
));
});
</script>
</body>
</html>Original example by UI Skills