Animated List
unlumen-ui/animated-listFreeComponent
A real-time push feed where new items animate in from the top with spring physics — Stripe Radar style.
Live preview
live · rendered by the registry
Rendered by Unlumen Ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.unlumen.com/r/animated-list.jsonSource
1"use client";23import * as React from "react";4import { AnimatePresence, motion } from "motion/react";56import { cn } from "@/lib/utils";78export type AnimationType = "scale" | "slide" | "fade" | "bounce";910export interface AnimatedListProps<T> {11 /** index 0 = newest */12 items: T[];13 renderItem: (item: T, index: number) => React.ReactNode;14 /** @default 8 */15 maxVisible?: number;16 /** @default 12 */17 gap?: number;18 /** @default "scale" */19 animation?: AnimationType;20 className?: string;21}2223function getAnimationVariants(type: AnimationType) {24 switch (type) {25 case "slide":26 return {27 initial: { opacity: 0, y: -30 },28 animate: { opacity: 1, y: 0 },29 exit: { opacity: 0, y: -20 },30 };31 case "fade":32 return {33 initial: { opacity: 0 },34 animate: { opacity: 1 },35 exit: { opacity: 0 },36 };37 case "bounce":38 return {39 initial: { opacity: 0, y: -20, scale: 0.8 },40 animate: { opacity: 1, y: 0, scale: 1 },41 exit: { opacity: 0, scale: 0.8 },42 };43 case "scale":44 default:45 return {46 initial: { opacity: 0, y: -20, scale: 0.95 },47 animate: { opacity: 1, y: 0, scale: 1 },48 exit: { opacity: 0, scale: 0.9 },49 };50 }51}5253export function AnimatedList<T extends { id: string | number }>({54 items,55 renderItem,56 maxVisible = 8,57 gap = 12,58 animation = "scale",59 className,60}: AnimatedListProps<T>) {61 const visible = items.slice(0, maxVisible);62 const variants = getAnimationVariants(animation);6364 return (65 <div className={cn("flex flex-col", className)} style={{ gap: `${gap}px` }}>66 <AnimatePresence mode="popLayout" initial={false}>67 {visible.map((item, index) => (68 <motion.div69 key={item.id}70 layout71 initial={variants.initial}72 animate={variants.animate}73 exit={variants.exit}74 transition={{75 type: "spring",76 stiffness: 350,77 damping: 28,78 layout: { type: "spring", stiffness: 350, damping: 28 },79 }}80 >81 {renderItem(item, index)}82 </motion.div>83 ))}84 </AnimatePresence>85 </div>86 );87}
What it pulls in
npm packages
Files it writes
More from Unlumen Ui
All 233 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| AI Chatai-chat | Unlumen Ui | Components | Paid | 2 deps | |
| Vercel Animate Countanimate-count | Unlumen Ui | Components | Free | 1 dep | |
| Animate Digitsanimate-digits | Unlumen Ui | Components | Free | 1 dep | |
| Animated Inputanimate-text-input-typing | Unlumen Ui | Components | Paid | 1 dep | |
| Apple Switchapple-switch | Unlumen Ui | Components | Free | 1 dep | |
| Aurora Barsaurora-bars | Unlumen Ui | Components | Free | 1 dep | |
| Aurora Bluraurora-blur | Unlumen Ui | Components | Free | 2 deps | |
| Aurora Cardaurora-card | Unlumen Ui | Components | Paid | 2 deps |
