Stagger List

Animated

A list whose items arrive one after another, in reading order.

Source
$npx @dinachi/cli@latest add stagger-list
  • Deploys
  • Incidents
  • Costs
  • Latency
  • Error rate
variant
stagger
duration
distance
key

Usage

import { StaggerList, StaggerListItem } from "@/components/ui/stagger-list"

const results = ["Frankfurt", "London", "Tokyo"]

export function Results() {
  return (
    <StaggerList>
      {results.map((city) => (
        <StaggerListItem key={city}>{city}</StaggerListItem>
      ))}
    </StaggerList>
  )
}

Examples

  • Deploys
  • Incidents
  • Costs
  • Latency
  • Error rate
Items arriving one after another.
import { StaggerList, StaggerListItem } from '@/components/ui/stagger-list';

export function Example() {
  return (
    <StaggerList className="w-56 space-y-2">
      {items.map((item) => (
        <StaggerListItem key={item.id}>{item.label}</StaggerListItem>
      ))}
    </StaggerList>
  );
}

Notes

Motion tier

Needs motion. add --all skips it; install with add --motion or by name.

Variants

  • rise lifts items in from below. Use it for top-to-bottom lists.
  • scale grows items in place. Use it for grids and card walls.
  • blur brings items into focus as they rise. Use it sparingly: it animates a filter, so its cost grows with item count.

When to use it

  • A list seen for the first time: search results, a dashboard's first paint, a feed's first page.
  • Skip it for lists that re-render on every keystroke, or content scrolled back to.

Behaviour

  • blur leaves filter: blur(0px) on each item, which makes it a containing block for fixed-position descendants. Use rise or scale if items contain one.
  • startOnView triggers 100px inside the viewport edge, not at a visible fraction.

API

variant"rise" | "scale" | "blur" = "rise"
How each item enters.
staggernumber = 0.05
Seconds between items. Keep it between 0.03 and 0.08.
delaynumber = 0
Seconds before the first item.
durationnumber = 0.3
Seconds for each item's own animation.
distancenumber = 8
Travel in px. Ignored by scale.
startOnViewboolean = true
Starts on scroll into view instead of mount. Runs once.

Accessibility

  • Keeps ul and li semantics.
  • Reduced motion keeps the fade and stagger; drops travel, scale and blur.