Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Typing Indicator Group Chat Block for Radix UI

A group thread with an In this chat pane of five people, each with a presence word and a simulate typing toggle, and a typing line under the log that says Kai is typing, Kai and Ana are typing or Kai, Ana and 2 others are typing.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Say who is typing, and say it right, with this typing indicator chat for React with Radix UI. A hairline frame with a plus mark on each corner holds a window of fixed height for Echoline, a group messenger, with a pane at the start called In this chat. It lists five people, each with initials, a name, "Online" or "Away" as a word and a Toggle that simulates that person typing; two are on when it opens. The line under the log is the catalog Typing Indicator Text, and its sentence comes from a pure function: "Kai is typing", "Kai and Ana are typing", "Kai, Ana and 2 others are typing", and nothing when none, with no list over three. The line is the last item of the log, so it is announced once. Your own composer lights the You row as "Typing" while the field holds text; sending posts a message and a member answers after a wait. On a phone a Toggle Group switches between Chat and People. The composer's Shine Button, the only colored control, sends, and the frame is ruled by Guides. It's for a group messenger, a team room or a support thread.

FAQ

What stays in the page, and how do I make it real?

Everything. The toggles stand in for typing events and the answer comes from a short typed script, so nothing is sent and no model runs, as the status line says. To wire it for real, feed the list of names from your presence channel (each person who sent a typing event in the last few seconds) into typingLine, and drop the toggles; the line, the log and the pane need no other change.

How does the sentence change with the count?

One name reads "Kai is typing", two read "Kai and Ana are typing", three list all three, and four or more name two and count the rest, "Kai, Ana and 2 others are typing", so the line never grows long. The names follow the roster's order, so the sentence does not reshuffle as people start and stop.

What does the You row do?

It shows "Typing" while your field holds text and "Online" when it is empty, a word as well as a glyph. In a real app this is where you would send your own typing event, throttled, as the field changes.

How is the line announced to a screen reader?

It is the last list item of the log region, which is announced as a log, so each change is read once in turn rather than on every keystroke. The status line under the panes is a separate polite region for results such as "Simulating Kai typing."

What happens under reduced motion?

The catalog Typing Indicator Text honours reduced motion, so the dots hold still and the words carry the meaning. Nothing else here animates but the first fade.

How does it look on a phone?

A Chat and People switch under the top of the window shows one pane at a time, People with a count; the status line stays visible under both. The window keeps its height and only the regions scroll.