AI CSS Animations

CSS AI Animations: Thinking, Streaming & Agent States

180 copy-paste animations for every state an AI feature moves through: thinking indicators, streaming replies, tool calls, agents waiting for approval, voice orbs, image generation progress, and the done and error states that close the loop.

Thought For Reasoning Disclosure

A collapsed Thought for 12s row whose chevron turns as the reasoning panel opens, the muted thoughts blur in beside a hairline rule, and the answer below slides down to make room.

thinking · chat · minimal

Streaming Code Block

A dark code block from a chat reply fills in line by line with syntax colors, line numbers arriving with each row and a soft highlight on the line being written. Each line is wiped in by clip-path.

streaming · card · dark

Inline Citation Pills

An answer writes itself sentence by sentence and a numbered citation pill springs in after each one. Then pill 2 lights up and its source card rises underneath, like a hovered reference.

streaming · chat · card

Agent File Edit Diff

An edit card for src/lib/auth.ts: two old lines blush red, three new ones push in green beneath them, and the +12 -3 counters tick up as the change lands. The counters are @property integers.

agent · tool-call · card

Agent Fleet Grid

A dashboard of six agents in a grid, each with a live status dot and a progress line. Running agents fill in bursts, flash green and start the next task, each on its own clock.

agent · card · dark

Agent Cursor Editing Code

A dark editor where an agent's named cursor opens a new line in auth.ts and types await limiter.consume(req.ip); with the line glowing as it is written. The text steps in by ch.

agent · streaming · dark

Agent Working an Issue

An issue row assigned to an agent as it moves Todo, In Progress, In Review, Done. The status ring fills like a pie through an animated @property, and the status and activity lines roll with each move.

agent · card · done

Codebase Search Results

A grep for rateLimit( across src and tests: a scan line sweeps the query bar, file hits slide in with their matching line numbers and the match count ticks up to 18. The count is an @property integer.

agent · tool-call · card · streaming

Deploy Pipeline

Build, Test and Deploy stage boxes run left to right: each spins in the accent, fills its connector and turns green with a time, then a Ready chip slides in with the live preview URL.

agent · done · card

Browser Automation Agent

A labelled agent cursor in a mini browser clicks the email field, types ada@lovelace.dev, then presses Create account, while the action log under the window rolls through click, fill and wait.

agent · tool-call · card · done

Git Commit Created

Three staged files stack up and collapse into a single commit node on the branch graph, then the short hash a3f9c2e types out beside the message and the change totals settle underneath.

agent · tool-call · card · done

Conversation Compacting

Compacting conversation: a scan reads down a stack of chat messages, the stack squeezes together into one summary block of 46 messages, and the context meter below drops from 82% to 31%.

agent · card · thinking

Agent Run Interrupted

An agent edits files one by one until the Esc keycap presses: the spinner stops on a square, the partial output dims, and Interrupted. What should I do instead? appears as the reply box takes focus.

agent · card · chat

Queued Follow-up Message

A follow-up typed mid-run waits in a dashed bubble with a Sends after this step chip. When pnpm test passes, the bubble lifts into the thread, fills solid, flips to Delivered and Claude replies.

agent · chat · card

Checkpoint Rewind

A row of five checkpoints with a Now marker that rewinds two stops to Limiter, leaving the later ones dashed and hollow. Then each changed file flips to Restored or Removed and the count reaches 3/3.

agent · card · done

Agent Clarifying Question

Claude stops to ask where login sessions should live. The question blurs in, three answer tiles spring up with number keys, then the card waits with a breathing ring and bouncing dots.

agent · chat · card · button

Diff Hunk Review

A diff for src/server/limiter.ts in three hunks, each with its own Reject and Accept. Focus lands on Accept, it presses, the hunk tints green as Accepted swaps in and the count climbs to 3 of 3.

agent · approval · card · done

Sandbox Blocked Request

A packet leaves the sandbox for registry.npmjs.org and bounces off a red shield: not on the allowlist. Allow domain presses, the shield turns green and the packet sails through to the globe.

agent · approval · error · card

Reviewer Agent Verdict

A writer agent's edit types into a code block, then a reviewer agent threads in under it: it reads, flags one line with a nit, and stamps an Approved badge while the card edge warms green.

agent · approval · card · done

Model Fallback Switch

A reply that hits an overloaded primary model: the Opus chip rings amber through three retries, gets struck out and swaps to Sonnet with a fallback note, then the answer streams in after all.

chat · error · card · streaming

Document Artifact Building

A document artifact writes itself the way a person would: the outline lands first as headings over skeleton lines, then each section fills in turn while the header counts Writing 2 of 3 to Ready.

streaming · card · done

Agent Session Sidebar

A sidebar of agent sessions whose status icons and subtitles change as you watch: one run finishes with a check, another stops for input in amber, and a waiting one picks back up and spins.

agent · chat · done · card

Response Branch Switcher

A regenerated reply with three versions: the arrows press, the reply slides sideways to the next branch and the 2 / 3 switcher ticks along, then it walks back. The counter is a @property integer.

chat · button · card

Tool Calls Folding Into a Summary

Six tool calls stream into a thread one by one, each spinning then checking off, until the group folds up into a single Ran 6 tools row with its diff totals and the agent's reply slides in below.

agent · tool-call · card · done

Skill Loaded Chip

Loaded skill: pdf. A chip pops in with a spinning ring, unfolds sideways to name the skill, drops open its files, then tucks away again while the agent carries on running the skill's script.

agent · tool-call · chat · sparkle

Post Edit Hook Check

Right after an edit lands, a PostToolUse hook opens beneath it: eslint --fix runs, prints that it fixed 2 problems and found 0 errors, the badge flips to Passed in 0.4s and the agent moves on.

agent · tool-call · card · done

AI Cursor in a Shared Doc

A shared doc where Maya's cursor sits on a selected word while a labeled Claude cursor writes a new sentence word by word, each fresh word glowing in the accent before it settles into the page.

agent · streaming · card

AI Email Draft Ready for Review

An agent fills in a new email: the recipient and subject wipe in, the body streams line by line, then the footer flips from Drafting to Waiting for you as the Review and send button lights up.

agent · approval · streaming · card · button

Shopping Agent Paused at Checkout

A shopping agent builds an order line by line while the total rolls up to $189.01, then stops short of paying: an amber Paused before purchase note drops in and a Confirm purchase button pulses.

agent · approval · card · button

AI Code Review Comments

A review pass sweeps down a diff and, as it crosses a risky line, a comment bubble springs out beside it with a red, amber or accent severity dot while the header count climbs to 3 comments.

agent · card · error

Live Meeting Notetaker

A meeting notetaker mid call: a red recording dot pulses by the timer, speaker lines transcribe in with a ring on whoever is talking, and action items lift out of the transcript into a list.

voice · agent · streaming · card

Undo Agent Action Toast

An agent archives a batch of GitHub notification emails, which slide out of the inbox. An Archived 24 emails toast springs up with a draining timer bar, Undo gets pressed and the rows slide back in.

agent · button · dark · card

Sandbox VM Booting

A cloud sandbox spinning up for an agent: the status chip breathes amber, boot log lines print with their timestamps under a progress bar and timer, then it flips green and settles on Ready in 2.1s.

agent · dark · done · tool-call

Agent Fix Loop Iterations

An agent's fix loop: Iteration 3 shows 2 tests failing, the status rolls through editing limiter.ts and rerunning pnpm test, then Iteration 4: all passing lands as the failure chart hits zero.

agent · error · done · card

How to use these ai animations

Open any state, copy the HTML into your markup and the CSS into your stylesheet. Nothing else is required: no JavaScript, no icon fonts, no images. Each snippet's classes are prefixed with its own name, so a whole chat UI can use several at once.

Set --aia-color to your brand accent and --aia-size to scale the piece; everything inside is measured in em. The demo text is placeholder copy: swap in your model's real output, tool names and file paths.

Live states carry role="status" or aria-live so screen readers hear the change, and every snippet ships with a prefers-reduced-motion rule. In your app, swap states by toggling a class or data attribute when the model's stream events arrive.

Frequently asked questions

How do I make an AI thinking animation in CSS?

Animate something that reads as attention without implying progress: a shimmer sweeping across a 'Thinking' label, breathing dots, or a slowly turning sparkle. Every thinking entry above is pure HTML and CSS with a role="status" label.

How do I show streaming text from an LLM?

Append tokens to the element as they arrive and let CSS handle the feel: a blinking caret after the last word, a soft fade on each new chunk, or a gradient mask on the trailing edge. The streaming entries show each look with static demo text.

What states should an AI agent UI show?

At least thinking, working (with the tool or step it is on), waiting for the person, done and failed. Showing which tool is running and what it touched builds more trust than a generic spinner.

Do these work with React, Vue or Svelte?

Yes. They are plain HTML and CSS, so paste the markup into any component and the CSS into its stylesheet, then switch states with a class.