CSS Typing Indicator
A chat bubble with three softly rising dots while someone types.
HTML
<div class="typing-indicator" role="status" aria-label="Someone is typing">
<span></span><span></span><span></span>
</div>
CSS
.typing-indicator {
display: inline-flex;
gap: 5px;
padding: 14px 16px;
border-radius: 18px 18px 18px 4px;
background: #fff;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.typing-indicator span {
width: 8px;
height: 8px;
border-radius: 50%;
background: #a1a1aa;
animation: typing-indicator-rise 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-indicator-rise {
0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
30% { transform: translateY(-5px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
.typing-indicator span {
animation-duration: 2.4s;
}
}
About this CSS Typing Indicator
This CSS Typing Indicator is 30 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, box shadows and Flexbox. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
Customize it
The colors in this snippet. Search and replace them to match your brand:
#fff#a1a1aa
How to use this typing indicator
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.typing-indicatorclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.