Typing indicator
A typing indicator says who's writing a reply in a conversation. It names up to three people, then says "Several people are typing…". It leaves out the person looking at the screen, and keeps its height when nobody is typing, so the messages above it don't jump.
Anatomy
A row of a fixed height with the dots and the sentence, plus a hidden status region that screen readers hear instead.
- Dots
- Sentence
- Row
Variants and states
Usage
- 01Put it between the messages and the composer, where people look while they wait for a reply.
- 02Keep it mounted for the life of the conversation. The status region has to be in the page before it changes, or screen readers miss the first announcement.
- 03Name at most three people. Past that, a list of names is harder to read than a count.
- 04In large rooms, consider turning it off. Teams does in chats of more than 20 people.
Translating it
format gets { count, names, list } and returns the whole sentence. Never
build it from fragments like name + " and " + other: Russian and Polish have
four plural forms, Arabic six and Japanese one, and the verb and the word order
change with them. Write one sentence per case, as an ICU message for instance:
{count, plural,
=0 {}
one {{list} is typing…}
other {{list} are typing…}
}with a separate message for "Several people are typing…" when names is
empty. Pass the same locale the messages use, so the names are joined in that
language.
Best practices
Accessibility
There's nothing to focus: the indicator only reports, so it never enters the tab order.
- 01The sentence goes to a polite role="status" region that's in the page from the start, outside the message log, so it doesn't mix with new messages.
- 02Announcements wait for the sentence to hold still for announceDelay milliseconds, 1.5 seconds by default, so a burst of people starting and stopping is heard once.
- 03When everyone stops typing, the region empties without saying anything.
- 04The dots and the visible text are hidden from screen readers, which hear the status region instead, with names in full.
- 05The dots can run for longer than five seconds, so under reduced motion they hold still as a plain ellipsis (WCAG 2.2.2).
Related components
- ReactionsLets people respond to content with an emoji in one tap.
- Sticker avatarAn avatar cut out like a die-cut sticker, with a paper edge that follows its shape and a status told by shape.
- Floating navA pill of destinations that floats above the bottom of a phone screen and steps aside while you scroll.
References
- Discord: typing start event, for the 10-second expiry
- WAI-ARIA status role
- WCAG 2.2.2 Pause, Stop, Hide
- ICU message format
- Intl.ListFormat