asafefe.dev

Animated List

Children that stagger in as they scroll into view. Ideal for feeds and notifications.

motion@soultel/use-reduced-motion-safe
Deploy succeeded
New signup
Payment received

Installation

$ pnpm dlx shadcn@latest add @soultel/animated-list

No namespace set up? npx shadcn@latest add https://asafefe.dev/r/animated-list.json works too.

Manual installation
  1. 1. Install the dependencies.
    terminal1 lines
    npm install motion
  2. 2. Copy the source from the Code tab into components/animated-list.tsx.

Usage

example.tsx11 lines
import { AnimatedList } from "@/components/animated-list"

export function Example() {
  return (
    <AnimatedList className="flex flex-col gap-2">
      <div>First</div>
      <div>Second</div>
      <div>Third</div>
    </AnimatedList>
  )
}

Props

PropTypeDefaultDescription
delaynumber0.12Stagger between children, in seconds.