A rounded chat bubble with a two-circle tail and three dots that darken in turn, while the bubble itself breathes. The fade-in-place dots are the iOS take on 'is typing'.
Also known as: imessage typing indicator, chat bubble typing dots, thought bubble typing.
<div class="ldr-imessage-typing-bubble" role="status" aria-label="Typing"> <span></span><span></span><span></span> </div>
.ldr-imessage-typing-bubble {
--s: var(--ldr-size, 48px);
--c: var(--ldr-color, #3b82f6);
position: relative;
display: inline-flex;
align-items: center;
gap: calc(var(--s) / 10);
padding: calc(var(--s) / 4.5) calc(var(--s) / 3.2);
border-radius: calc(var(--s) / 2);
background: color-mix(in srgb, var(--ldr-color, #3b82f6) 20%, transparent);
transform-origin: 0 100%;
animation: ldr-imessage-typing-bubble-breathe 1.5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.ldr-imessage-typing-bubble::before,
.ldr-imessage-typing-bubble::after {
content: "";
position: absolute;
border-radius: 50%;
background: color-mix(in srgb, var(--ldr-color, #3b82f6) 20%, transparent);
}
.ldr-imessage-typing-bubble::before {
left: calc(var(--s) / -9);
bottom: calc(var(--s) / -9);
width: calc(var(--s) / 5.5);
height: calc(var(--s) / 5.5);
}
.ldr-imessage-typing-bubble::after {
left: calc(var(--s) / -4.2);
bottom: calc(var(--s) / -4.2);
width: calc(var(--s) / 11);
height: calc(var(--s) / 11);
}
.ldr-imessage-typing-bubble span {
width: calc(var(--s) / 6.5);
height: calc(var(--s) / 6.5);
border-radius: 50%;
background: var(--c);
opacity: 0.35;
animation: ldr-imessage-typing-bubble-dot 1.5s ease-in-out infinite;
}
.ldr-imessage-typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.ldr-imessage-typing-bubble span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ldr-imessage-typing-bubble-dot {
0%, 55%, 100% { opacity: 0.35; transform: scale(0.9); }
25% { opacity: 1; transform: scale(1.05); }
}
@keyframes ldr-imessage-typing-bubble-breathe {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
.ldr-imessage-typing-bubble, .ldr-imessage-typing-bubble *, .ldr-imessage-typing-bubble::before, .ldr-imessage-typing-bubble::after, .ldr-imessage-typing-bubble *::before, .ldr-imessage-typing-bubble *::after {
animation-duration: 3s;
}
}--ldr-color on the element or a parent.
Currently previewing #3b82f6.--ldr-size. Every dimension in the snippet is
derived from it. Currently previewing 64px.animation shorthand.
Delays on the children are relative, so they keep their rhythm.role="status" and an
aria-label so screen readers announce the wait. The reduced-motion rule
at the end slows the animation for users who asked for less motion.