# Animated List

> A live feed where new items drop in at the top with a spring and older ones slide down. Ideal for activity streams, notifications and happening now sections.

- Kind: Motion component (Motion)
- Docs: https://ui.minidev.pro/docs/animated-list
- Source (registry JSON with the full file): https://ui.minidev.pro/r/animated-list.json
- License: MIT. One file, yours to edit after install.

## When to use

Use it for "happening now" sections, notification previews and activity streams on marketing pages. Items cycle through `items` on a timer while the list is on screen, and pause while the pointer is over it or it has keyboard focus (the list is a tab stop, named by `label`). Reduced motion shows the first `max` items, still. For a static list of notifications use a plain list; for a one-off reveal use BlurFade.

## Installation

### shadcn CLI (copies the source into your project)

```bash
npx shadcn@latest add @minidev/animated-list
```

Writes `components/ui/animated-list.tsx` and installs its npm dependencies. Older CLI versions: `npx shadcn@latest add https://ui.minidev.pro/r/animated-list.json`.

### npm package

```bash
npm i minidev-ui-kit lucide-react motion
```

Add the tokens to your global stylesheet once:

```css
@import "tailwindcss";
@import "minidev-ui-kit/styles.css";
@source "../node_modules/minidev-ui-kit";
```

Next.js also needs `transpilePackages: ["minidev-ui-kit"]` in next.config.

## Import

After the shadcn install:

```tsx
import { AnimatedList } from "@/components/ui/animated-list"
```

From the npm package:

```tsx
import { AnimatedList } from "minidev-ui-kit/premium/animated-list"
```

## Usage

```tsx
import { AnimatedList } from "@/components/ui/animated-list"

export function Example() {
  return (
    <AnimatedList />
  )
}
```

## Props

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `items` | `ListItem[]` | `DEFAULT` | no | Items to cycle through, newest first. |
| `interval` | `number` | `1800` | no | Milliseconds between arrivals. |
| `max` | `number` | `4` | no | How many items to keep on screen. |
| `label` | `string` | `"Live activity"` | no | Accessible name for the list, which is a tab stop so keyboard users can pause it. |
| `className` | `string` | - | no |  |

## Examples

### Custom items

Items cycle in order and wrap around; each takes a lucide icon, a title, a detail line and a time label.

```tsx
const DEPLOY_EVENTS = [
  { icon: RocketIcon, title: "Deploy started", detail: "lumen-web 2.14 → production by Theo Okafor", time: "now" },
  { icon: CircleCheckIcon, title: "Checks passed", detail: "412 tests, 0 failures in 1m 48s", time: "2m" },
  { icon: GitPullRequestIcon, title: "PR #418 merged", detail: "Faster PDF export by Sam Lowe", time: "6m" },
  { icon: TriangleAlertIcon, title: "Rollback", detail: "lumen-api 1.9.3 → 1.9.2 after error spike", time: "14m" },
]

<AnimatedList items={DEPLOY_EVENTS} />
```

### Faster with more rows

interval is the gap between arrivals in milliseconds and max is how many stay on screen before the oldest leaves.

```tsx
<AnimatedList interval={1100} max={6} />
```

### Beside marketing copy

Pair the feed with a headline in a two column section; the list pauses when it scrolls out of view.

```tsx
<section className="grid w-full items-center gap-8 md:grid-cols-2">
  <div>
    <h2 className="text-2xl font-medium tracking-[-0.03em] text-fg">Know the moment money moves</h2>
    <p className="mt-3 text-sm leading-[1.6] text-fg-muted">
      Payments, signups and deploys show up in Lumen as they happen, so the Northwind finance team stopped refreshing dashboards.
    </p>
    <Button variant="outline" className="mt-5">See the live demo <ArrowRightIcon /></Button>
  </div>
  <AnimatedList max={3} className="mx-auto" />
</section>
```

## Keyboard interactions

| Key | Action |
| --- | --- |
| `Tab` | Focuses the list, which pauses the feed until focus leaves. |

## Accessibility

- It renders a `<ul>` of `<li>` items. There is no live region, so screen readers are not interrupted by each arrival.
- The `<ul>` is a tab stop with `tabIndex={0}`, a `focus-visible` ring and an `aria-label` from `label` ("Live activity" by default). Hover or keyboard focus pauses the feed, so it can be read (WCAG 2.2.2).
- Under reduced motion `layout` animation is off and enter and exit transitions take 0s.

## FAQ

### Can I push real-time events into AnimatedList?

Not as is. It cycles through `items` on a timer (`interval`, 1800ms by default) and loops back to the first item, so it suits a demo feed on a marketing page. For a real stream of events use [`ActivityFeed`](https://ui.minidev.pro/docs/activity-feed) or [`NotificationInbox`](https://ui.minidev.pro/docs/notification-inbox).

### Does it keep animating when nobody is looking?

No. The timer only runs while at least 40% of the list is on screen, and it pauses while the pointer is over it or the list has keyboard focus. Under reduced motion it shows the first `max` items and never changes.

## Rules for generating code

- Use semantic tokens only (bg, surface, sunken, border, fg, fg-muted, fg-subtle, ink, accent, success, warning, danger). Never raw hex or palette steps like blue-500.
- Shadows only from the set: shadow-xs, shadow-sm, shadow-raised, shadow-md, shadow-lg, shadow-overlay.
- Numbers use tabular-nums. Dark mode is the `dark` class on <html>; components never branch on theme.

## Dependencies

- npm: `lucide-react`, `motion`

## Related

- [Blur Fade](https://ui.minidev.pro/docs/blur-fade/md): React reveal wrapper that fades, unblurs and lifts children into place as they scroll into view, with delay, duration, direction and once props.
- [Animated Feature Row](https://ui.minidev.pro/docs/animated-feature-row/md): A row of feature cards that slide up with a staggered delay when scrolled into view. Pass title and description pairs; reduced motion keeps them still.
- [Card Tilt](https://ui.minidev.pro/docs/card-tilt/md): A card that tilts in 3D toward the pointer on springs, with an accent glare that follows the cursor. It stays flat when reduced motion is preferred.
- [Cursor Spotlight Panel](https://ui.minidev.pro/docs/cursor-spotlight-panel/md): A panel whose accent radial spotlight follows the cursor, driven by Framer Motion values without re-renders. It shows a still surface for reduced motion.
- [Device Frame Stack](https://ui.minidev.pro/docs/device-frame-stack/md): Three device frames labelled mobile, app and docs that spring into a fanned, rotated stack when scrolled into view. Works as a hero or feature visual.
- [Flip Stat Board](https://ui.minidev.pro/docs/flip-stat-board/md): A stat board where each number counts up with digits that flip in on a spring once in view. Pass values and labels; reduced motion shows the final value.

---

All 557 components: https://ui.minidev.pro/llms.txt (full text: https://ui.minidev.pro/llms-full.txt).
