shadimage
corr
componentanimated-listsource: ok · refreshed

Animated List

A generic list wrapper with Motion entry, exit, and reorder transitions.

npx shadcn add "https://ui.corr.sh/r/animated-list.json"
free

No selection tags yet — empty means no evidence, not lack of support.

Dependencies

Bundle weight · medium
animationmotion

Files1 · source cached 10/8/2026, 8:40:15 AM

registry/corr/components/animated-list.tsx
"use client"

import * as React from "react"
import { AnimatePresence, motion, useReducedMotion } from "motion/react"

import { cn } from "@/lib/utils"

export function AnimatedList<TItem extends { id: string }>({
  items,
  renderItem,
  className,
}: {
  items: TItem[]
  renderItem: (item: TItem) => React.ReactNode
  className?: string
}) {
  const reduceMotion = useReducedMotion()

  return (
    <motion.div layout className={cn("grid gap-2", className)}>
      <AnimatePresence initial={false}>
        {items.map((item) => (
          <motion.div
            key={item.id}
            layout
            initial={{ opacity: 0, y: reduceMotion ? 0 : 8 }}
            animate={{ opacity: 1, y: 0 }}
            exit={{ opacity: 0, scale: reduceMotion ? 1 : 0.98 }}
            transition={{ duration: reduceMotion ? 0 : 0.18 }}
          >
            {renderItem(item)}
          </motion.div>
        ))}
      </AnimatePresence>
    </motion.div>
  )
}

More from corr

Browse all components in this library →