webdevpuneet.com

AI Thinking Loader — Free HTML CSS JS Chat Loading Snippet

AI Thinking Loader · Loaders · Plain HTML, CSS & JS · Live preview

CategoryLoaders

Copy & paste

Source Code

<div class="al-stage">
  <div class="al-bubble">
    <div class="al-orb" aria-hidden="true"></div>
    <div class="al-lines">
      <span class="al-status" id="alStatus">Thinking…</span>
      <div class="al-skeleton"><span></span><span></span><span></span></div>
    </div>
  </div>
</div>

Extend with AI

Take This Snippet Further With AI

The AI prompt for this one is for Patreon supporters ($3 a month), along with a site with no ads. Supporters enter the passcode once and it is remembered in this browser.

· Become a supporter

What's included

Features

Spinning gradient orb
A conic ring signals the AI is working.
Shimmering status
Clipped-gradient sheen sweeps the label.
Cycling phrases
Narrated progress with smooth fades.
Shimmer skeleton
Staggered bars preview the answer.
Three coordinated motions
Orb, text, and skeleton animate together.
Pure-CSS animation
JS only swaps phrases.
Chat-ready layout
Drops in as a message placeholder.
Fully themeable
Colors, phrases, and timing are tunable.

About this UI Snippet

AI Thinking Loader — A Chat Loading State That Feels Alive

Screenshot of the AI Thinking Loader snippet rendered live

The AI thinking loader is the loading state that has become standard in chat and assistant interfaces: a gradient orb spins, a shimmering "Thinking…" label cycles through status phrases, and a skeleton of shimmer bars hints at the response forming. This snippet builds the whole thing with plain HTML, CSS, and a small vanilla JavaScript phrase cycler — a far more engaging wait than a bare spinner.

The spinning gradient orb

The orb is a circle filled with a four-color conic-gradient that rotates via the alSpin keyframe, with an ::after pseudo-element inset by 4px and filled with the bubble background — turning the solid disc into a glowing ring. This is the classic "AI is working" emblem: a rainbow ring spinning beside the message. It is pure CSS and costs only one rotating element.

Shimmering status text

The status label uses the same clipped-gradient shimmer technique as polished "shiny text": the text is transparent and filled with a gradient that is mostly muted gray with a bright band, animated across the letters so a sheen sweeps through the word. That motion makes the status feel active — the assistant is not just stuck on a static label, it is visibly working. The shimmer is pure CSS via background-clip: text.

Cycling status phrases

Real assistants reassure users by narrating progress, so JavaScript rotates the label through phrases like "Reading context…", "Drafting a response…", and "Checking facts…" on an interval. Each change fades the label out and back in (a quick opacity transition) so the phrases swap smoothly rather than snapping. Communicating steps, even simulated ones, makes a wait feel shorter and more trustworthy than a single unchanging word.

The shimmer skeleton

Below the status, three skeleton bars of decreasing width preview the shape of the incoming answer. Each bar has a moving gradient (alWave) that sweeps a lighter band across it, with staggered animation-delays so the shimmer ripples down the lines. This is the standard content-placeholder technique, here signaling that text is about to stream in — pairing the orb (it is thinking) with the skeleton (a response is coming).

Three coordinated motions, all CSS

The orb spin, the text shimmer, and the skeleton wave are independent CSS animations running together, which is what makes the loader feel rich without any animation library. JavaScript only handles the discrete job of swapping phrases, keeping the per-frame work entirely on the compositor.

Customizing it

Edit the PHRASES array to match your assistant voice, recolor the orb gradient and the shimmer band, change the number and widths of skeleton bars, or retime any of the loops. Drop it into a chat thread as the assistant message placeholder, then replace it with the real streamed response when it arrives. Pair it with an ai chat interface or a typing indicator for a complete conversation UI.

Step by step

How to Use

  1. 1
    Paste HTML, CSS, and JSA chat bubble shows a spinning orb and a shimmering status.
  2. 2
    Watch the orbA rainbow gradient ring spins beside the text.
  3. 3
    Read the statusThe shimmering label cycles through progress phrases.
  4. 4
    See the skeletonShimmer bars ripple to preview the incoming answer.
  5. 5
    Edit the phrasesChange the PHRASES array to your assistant voice.
  6. 6
    Swap in the responseReplace the loader with the streamed reply.

Real-world uses

Common Use Cases

AI chat waiting states
Show a spinning conic-gradient orb and a shimmering Thinking label inside an AI chat interface while the model prepares its reply.
Floating assistant widgets
Pair with a floating chat widget so a support bot signals work in progress without a bare spinner.
Content generation screens
Narrate progress with cycling phrases that fade smoothly, while staggered shimmer bars preview the shape of the answer to come.
Richer typing indicators
Offer a more informative alternative to a plain typing indicator when the wait is several seconds long.
Prompt submit feedback
Follow an AI prompt composer send with this state, using a clipped-gradient sheen sweeping across the status label.
Related: Auto-Retry Loader with Countdown and Manual Retry
See the Auto-Retry Loader with Countdown and Manual Retry for a related loaders pattern worth pairing with this one.
Related: Barcode Scan Sweep Loader
See the Barcode Scan Sweep Loader for a related loaders pattern worth pairing with this one.
Related: Gradient Mesh Loading Screen
See the Gradient Mesh Loading Screen for a related loaders pattern worth pairing with this one.

Got questions?

Frequently Asked Questions

The orb is a circle filled with a four-color conic-gradient that rotates on a keyframe, with an ::after pseudo-element inset by 4px and filled with the bubble background. That turns the solid disc into a glowing rainbow ring, the familiar AI-working emblem, using just one rotating element in pure CSS.

The label is transparent and filled with a gradient via background-clip: text — mostly muted gray with a bright band — animated across the letters so a sheen sweeps through the word. The motion makes the status feel active and working rather than a static stuck label, and it is entirely CSS.

Narrating progress reassures users and makes a wait feel shorter. JavaScript rotates the label through phrases like Reading context and Drafting a response on an interval, fading each out and back in so they swap smoothly. Even simulated steps feel more trustworthy than a single unchanging word.

Three bars of decreasing width with a moving shimmer gradient and staggered delays preview the shape of the incoming answer. Combined with the spinning orb, it pairs the message that the assistant is thinking with the message that a response is about to stream in, which sets the right expectation during the wait.

Render it as a chat message placeholder component and keep the phrase index in state, updating it on an interval set up in a mount effect with cleanup. The orb, shimmer, and skeleton are pure CSS. Swap the component for the real response when streaming begins. In Tailwind, define the spin, shine, and wave keyframes in the config and apply them with utilities.