# How to animate an AI chat interface in React

URL: https://beui.dev/guides/ai-chat-animations-react
Updated: 2026-11-13

Good AI chat animation does three jobs: it shows the model is working, it reveals the reply without making the page jump, and it confirms what the user just did. Use short opacity and transform transitions for new messages, a shimmer or progress line while the model thinks, a stable surface for streamed text, and turn movement off for people who ask for reduced motion. This guide covers each part with the beUI agent components.

## What to animate, and what to keep still

A chat changes all the time, so motion has to earn its place. Animate the moments that need feedback and keep everything else still.

- Animate: new messages entering, the thinking state, the send button, tool calls opening and closing, and a voice orb reacting to sound.
- Keep still: each streamed token, the scroll position while the user reads, and anything that would bounce or shift text the user is reading.

## Thinking and loading states

Between sending a prompt and the first token, the user needs to see that something is happening. A shimmer across a short status line, such as Thinking or Searching, works better than a spinner because it says what the model is doing.

For longer agent runs, show progress as steps. The beUI Loading States page has three variants: Thinking Shimmer for a single status line, Reasoning Text for cycling messages, and Agent Progress for live steps.

```bash
npx shadcn@latest add @beui/thinking-shimmer @beui/agent-progress
```

## Streaming the reply without layout jumps

Do not animate each token. Render streamed text into a surface that only grows downward, so lines above never move. beUI Streaming Response keeps its size stable while content arrives and shows actions only when the reply is done.

Scrolling matters as much as the text. Message Scroller follows the live edge while the reply streams, and stops following the moment the reader scrolls up, so the page never pulls them away from what they are reading.

## Message entry and grouping

New messages should fade in and rise a few pixels with an ease-out curve in about 200ms. Exits should be faster than entries. Group consecutive messages from the same sender so only the new bubble moves, not the whole list. beUI Message and Message Bubble handle grouping, alignment and long replies that collapse.

## Agent steps: plans, tool calls and approvals

Agents do work between messages. Show a plan as a list whose items change state in place, so nothing jumps. Tool calls and their output read best as a short summary that expands on click. When the agent needs permission, use a clear card with allow and deny actions instead of a modal.

beUI Todo List, Agent Activity, Tool Result and Tool Approval cover these, each with motion that stays in place.

## Voice agents

In a voice chat there is no text to watch, so the visual has to show who is talking. beUI Voice Orb is a shader sphere that reacts to microphone or audio levels, so it moves when the user or the agent speaks and rests when nobody does.

## Reduced motion and accessibility

Read the user's setting with useReducedMotion from motion/react. When it is on, keep opacity and color changes and drop movement, including the shimmer sweep and message rise.

Announce replies to screen readers with a polite live region, and announce the finished reply rather than each token. Keep focus in the prompt input after sending so keyboard users can type the next message right away.

## Components

- [Agent Loading States](https://beui.dev/components/agents/loading-states): Three thoughtful loading states for AI interfaces: shimmering status text, live agent progress, and cycling reasoning phrases.
- [Streaming Response](https://beui.dev/components/agents/streaming-response): A stable response surface with completion actions, rendered content, and an expandable source summary.
- [Message Scroller](https://beui.dev/components/agents/message-scroller): A reader-aware conversation viewport that follows streamed output at the live edge and releases control when the reader moves away.
- [Message](https://beui.dev/components/agents/message): Composable conversation primitives for message rows, grouped bubbles, avatars, metadata, live markers, and a mount-only trailing-edge pop-up for newly sent rows.
- [Todo List](https://beui.dev/components/agents/todo-list): A collapsible agent task plan with morphing status marks, a completion count, compact metadata, and smooth list updates.
- [Tool Approval](https://beui.dev/components/agents/tool-approval): A human-in-the-loop permission card for reviewing tool details, allowing once, remembering access, or denying execution.
- [Voice Orb](https://beui.dev/components/agents/voice-orb): Breathing liquid voice visualization with flowing highlights, custom pigments and a soft, voice-reactive silhouette. Accepts a normalized level, MotionValue or caller-owned audio analyser, pauses offscreen and supports reduced motion.

## FAQ

### Should I animate each token as it streams in?

No. Animating every token makes the text flicker and costs performance. Let text appear as it arrives in a surface that only grows downward.

### How long should chat animations be?

Keep most under 300ms. About 200ms for a message entering, faster for exits, and 100 to 160ms for button press feedback.

### What should a thinking state show?

Say what the model is doing, such as Thinking or Searching, with a subtle shimmer. For long agent runs, show the steps as they happen.

### How do I respect reduced motion in an AI chat?

Use useReducedMotion from motion/react. Keep fades and color changes, and remove movement such as slides, shimmers and orb motion.