vnhax
Animations & FeedsMagicUI PatternCopy-paste code · Accessibility notes

Animated List

Dynamic notification and activity feed with staggered entrance transitions, auto-flow, and pause controls.

Interactive Live Preview

Test responsive viewport scaling & interactions live
Live Stream
💳
Payment ConfirmedJust now

$120.00 from Stripe webhook

🚀
Edge Deployment Live1m ago

Edge cache warmed across 34 regions

🧠
Model Checkpoint Saved3m ago

Llama-3-8B fine-tune epoch 4 complete

Engineering Specification

Component Architecture & Rationale

The Animated List component powers real-time event streams, user activity feeds, and notification dashboards. As new events occur, new items smoothly expand into the top of the list while existing items stagger downward with calibrated spring physics. Includes automated interval simulation, hover-to-pause capability, and complete accessibility for assistive screen readers.

Implements a circular queue buffer with CSS keyframe transitions for transforms and opacities. Screen reader updates are routed through ARIA live regions with aria-live="polite" to avoid interrupting user focus, while users with prefers-reduced-motion receive instantaneous transitions.

Key Technical Features

  • ✓Spring-calibrated staggered entrances with smooth height interpolation
  • ✓Configurable addition interval with pause-on-hover capability
  • ✓Accessible ARIA live announcement for real-time telemetry
  • ✓Zero external motion library dependency required (native React + CSS)
  • ✓Responsive design with fixed maximum height container and overflow clipping

Complete Production Source Code

Standalone, dependency-free implementation. Drop directly into your project.

1. React 19 / TypeScript Component (AnimatedList.tsx)

TypeScript + Semantic JSX
import React, { useState, useEffect } from 'react';

export interface FeedItem {
  id: string;
  name: string;
  description: string;
  time: string;
  icon: string;
  color: string;
}

export interface AnimatedListProps {
  items: FeedItem[];
  delay?: number;
  className?: string;
}

export const AnimatedList: React.FC<AnimatedListProps> = ({
  items,
  delay = 2500,
  className = '',
}) => {
  const [index, setIndex] = useState(0);
  const [isPaused, setIsPaused] = useState(false);

  useEffect(() => {
    if (isPaused) return;
    const interval = setInterval(() => {
      setIndex(prev => (prev + 1) % items.length);
    }, delay);
    return () => clearInterval(interval);
  }, [items.length, delay, isPaused]);

  const visibleItems = React.useMemo(() => {
    return items.slice(0, index + 1).reverse().slice(0, 4);
  }, [items, index]);

  return (
    <div
      className={`animated-list-container ${className}`}
      onMouseEnter={() => setIsPaused(true)}
      onMouseLeave={() => setIsPaused(false)}
      role="log"
      aria-live="polite"
      aria-label="Real-time activity stream"
    >
      {visibleItems.map(item => (
        <div key={item.id} className="animated-list-card">
          <div className="animated-list-icon" style={{ backgroundColor: item.color }}>
            {item.icon}
          </div>
          <div className="animated-list-info">
            <div className="animated-list-row">
              <span className="animated-list-name">{item.name}</span>
              <span className="animated-list-time">{item.time}</span>
            </div>
            <p className="animated-list-desc">{item.description}</p>
          </div>
        </div>
      ))}
    </div>
  );
};

2. Vanilla CSS Stylesheet (Zero-Dependency)

Native CSS Tokens & Transitions
.animated-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}
.animated-list-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.animated-list-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.animated-list-info { flex: 1; }
.animated-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.animated-list-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
}
.animated-list-time {
  font-size: 11.5px;
  color: #94a3b8;
}
.animated-list-desc {
  font-size: 12.5px;
  color: #64748b;
  margin-top: 2px;
}

3. Tailwind CSS Classes Variant

Tailwind v3 & v4 Utility Equivalents
<!-- Animated List Item (Tailwind) -->
<div class="flex items-center gap-3 rounded-xl border border-neutral-200 bg-white p-3.5 shadow-sm transition-all duration-300 dark:border-neutral-800 dark:bg-neutral-900">
  <div class="flex h-10 w-10 items-center justify-center rounded-lg bg-blue-50 text-blue-600 dark:bg-blue-950 dark:text-blue-400">
    ⚡
  </div>
  <div class="flex-1">
    <div class="flex items-center justify-between text-xs font-semibold text-neutral-900 dark:text-white">
      <span>Security Alert</span>
      <span class="text-neutral-400">Just now</span>
    </div>
    <p class="text-xs text-neutral-500">API key rotated successfully.</p>
  </div>
</div>

Installation & Integration Guide

Steps to add this component to Next.js (App Router), Vite, or Astro projects.

CLI Installation CommandShadcn / MagicUI Compatible
npx shadcn@latest add "https://magicui.design/r/animated-list"

Step 1: Install Component

npm install # no external dependencies required

Step 2: Implement Notification Stream

import { AnimatedList } from '@/components/AnimatedList';

const NOTIFICATIONS = [
  { title: "Payment Received", desc: "$240 from Acme Corp", time: "1m ago", icon: "💰" },
  { title: "Deployment Live", desc: "Production build v2.4.0 active", time: "3m ago", icon: "🚀" },
  { title: "New Developer Joined", desc: "Elena connected via GitHub", time: "5m ago", icon: "👤" },
];

<AnimatedList items={NOTIFICATIONS} delay={2000} />

Props & API Reference

TypeScript interfaces, default values, and runtime behavior.

PropTypeDefaultDescription
itemsNotificationItem[]RequiredArray of items to display in the animated stream.
delaynumber2500Interval in milliseconds between automatic item additions.
maxItemsnumber5Maximum visible cards preserved in the stream buffer.
classNamestring''Custom CSS class for container wrapper.

Accessibility & Performance Notes

♿

Accessibility notes

ARIA Semantic Annotations

  • Container uses role="log" with aria-live="polite" so screen readers can consume feed updates without voice interruption.
  • Hover-to-pause allows low-vision users to read notifications at their own pace.

Keyboard Navigation

  • List elements support manual focus when interactive buttons are enclosed.
  • Respects prefers-reduced-motion media query by disabling keyframe translation.
⚡

Performance Tips

Keep the maximum rendered array slice capped at 4-5 items to avoid unnecessary DOM node allocation. These are design notes, not measurements: check your own page with Lighthouse or PageSpeed Insights.

High-Quality Interface Engineering

These components are written as plain React and CSS so you can read, copy and change every line. Several are adapted from the open-source Magic UI and UI-Layouts libraries, which are credited on each page. Test them in your own layout, with your own content, before you ship.