What Is a Typing Indicator? How It Works in Chat Apps
Those three moving dots tell you a reply is on the way. Here's how a typing indicator travels between apps, how to keep it from flooding your server and when to let users turn it off.
Typing indicator vs read receipt
|
Typing indicator |
Read receipt | |
|---|---|---|
|
What it tells you |
Someone is writing right now |
Someone has opened your message |
|
When it's sent |
While the user types, and when they stop |
Once, when the message is displayed |
|
How long it matters |
A few seconds |
Permanently, shown as ticks or "Seen" |
|
Stored? |
Usually not; it's a passing signal |
Usually yes, with a timestamp |
|
If an event is lost |
The indicator sticks or never shows; a timeout fixes it |
The sender sees the wrong status until the next sync |
|
Privacy concern |
Reveals activity and hesitation |
Reveals that a message was read and ignored |
What is a typing indicator?
A typing indicator is the small cue under a conversation that tells you the other person is composing a reply. WhatsApp, iMessage, Slack and most support chat widgets show one. It keeps people in the conversation: instead of leaving, they wait a few seconds for the answer.
Unlike a message, a typing indicator has no content and no history. It's a short-lived ephemeral event that only matters while it's happening, which is why apps send it differently from messages.
How typing indicators work
1. The typist's app sends a start event
When the user starts typing in a conversation, the app sends a small event naming the conversation and the sender. It goes over the same real-time connection the app uses for messages, typically a WebSocket, so it arrives within a fraction of a second.
2. The server relays it
The chat server forwards the event to the other members of that conversation who are online. Most servers don't store it, and there's no point sending a push notification for it.
3. The other app shows the indicator
The receiving app shows "Alice is typing..." or animated dots. In a group it may show several names, or "Several people are typing".
4. A stop event hides it
The typist's app sends an end event when the user sends the message, clears the input, leaves the screen or stops typing for a few seconds.
Throttle the events
Sending an event on every keystroke would flood the server and every receiver. Send one start event per burst of typing, refresh it every few seconds during long messages, and send one end event after a short idle period. The receiver should also hide the indicator on its own after a timeout, in case the end event is lost because the typist closed the app or lost signal.
Typing indicator example in JavaScript
This example uses the CometChat JavaScript SDK. The sender throttles events with timers, and the receiver uses a fallback timeout so the indicator never gets stuck.
// Sender: one start per burst of typing, one end after a pause
const indicator = new CometChat.TypingIndicator('bob', CometChat.RECEIVER_TYPE.USER);
const IDLE_MS = 3000; // send "end" after 3 s without a keystroke
const RESEND_MS = 5000; // refresh "start" during long messages
let lastStart = 0;
let idleTimer = null;
function onInput() {
if (Date.now() - lastStart > RESEND_MS) {
CometChat.startTyping(indicator);
lastStart = Date.now();
}
clearTimeout(idleTimer);
idleTimer = setTimeout(stopTyping, IDLE_MS);
}
function stopTyping() { // also call this right after sending a message
clearTimeout(idleTimer);
if (lastStart) CometChat.endTyping(indicator);
lastStart = 0;
}
input.addEventListener('input', onInput);
input.addEventListener('blur', stopTyping);
// Receiver: show the indicator, and hide it even if "end" never arrives
const hideTimers = {};
CometChat.addMessageListener('typing-ui', new CometChat.MessageListener({
onTypingStarted: (t) => {
const uid = t.getSender().getUid();
showTyping(uid);
clearTimeout(hideTimers[uid]);
hideTimers[uid] = setTimeout(() => hideTyping(uid), RESEND_MS + 3000);
},
onTypingEnded: (t) => {
const uid = t.getSender().getUid();
clearTimeout(hideTimers[uid]);
hideTyping(uid);
},
}));
Rule of thumb: one start per burst, one end after a pause, and a timeout on the receiving side. That covers almost every typing indicator bug.
Where typing indicators help
One-to-one chat: the classic case. People wait for a reply instead of leaving the app.
Group chat: shows who is about to respond, which cuts down on people replying over each other.
Customer support: tells a waiting customer that an agent is writing an answer, which reduces "hello?" follow-ups.
AI agents and bots: a typing or "thinking" state covers the seconds a model takes to generate a reply.
Marketplaces and dating apps: signals interest and keeps a conversation going.
Privacy and pitfalls
Let users turn it off. Some people find typing indicators stressful, or don't want others to see them start and stop a reply. A setting that disables sending (and usually receiving) is good practice.
Never send the text. A few apps have previewed what someone is typing before they press send. Send only the fact that someone is typing.
Only send it to the conversation. The event should reach members of that conversation, not contacts or followers.
Large groups get noisy. In channels with hundreds of members, cap the names shown or turn the feature off.
Stuck indicators. If an end event is lost, the indicator stays forever. Always add a receiver-side timeout.
Too many events. Unthrottled events can hit rate limits and waste battery on mobile.
Typing indicators in CometChat
If you're building chat with CometChat, typing indicators are part of the SDK. For a longer look at why they matter, read our post on typing indicators, or see the Android typing indicator tutorial for a full build.
Send and receive typing events with two calls
Create a
TypingIndicatorwith a user or group ID, then callCometChat.startTyping()andCometChat.endTyping(). Both are fire-and-forget. Receivers getonTypingStartedandonTypingEndedin aMessageListener, and can read who is typing withgetSender(). You can attach custom data withsetMetadata(). If you use the React UI Kit, the message composer sends typing events for you, and you can switch them off withdisableTypingEvents.
Frequently asked questions
What does a typing indicator mean?
It means the other person has the conversation open and is writing a message right now. It disappears when they send it, delete it or stop typing for a few seconds.
How long does a typing indicator stay on?
Until the typist sends the message or stops typing for a short period, often a few seconds. Well-built apps also hide it after a timeout in case the stop signal never arrives.
Can you turn off typing indicators?
In many apps, yes. Whether you can depends on the app. If you're building one, offering a setting to turn them off is good practice for privacy.
Do typing indicators show if you type and delete?
Usually yes. The indicator appears when you start typing and disappears when you clear the input or stop, so the other person may see it come and go.
How are typing indicators sent?
As small real-time events over a persistent connection such as a WebSocket. The server passes them to the other people in the conversation and normally doesn't store them.