Typing Indicator, animated React component
A free React typing indicator for chat. Three liquid dots ride a wave inside a bubble, then fold away and the same bubble opens into the message, word by word. Names under the bubble say who is typing, avatars stack when several people are, and the wave quickens with the crowd.
- Free
- AI Components
- Spring
Like Typing Indicator? 287 more are in Pro.
Pro unlocks all 287 Pro components, every template and block, and everything we release next. Typing Indicator stays free.
Set it up, copy the code
Choose values for the main props and the JSX on the right updates to match.
Show the dots (true) or the message (false). Leave it out and the component runs by itself.
The message the bubble opens into when typing stops.
Colours for a light or a dark page.
Alternates between typing and the message until the visitor touches it. Never runs under reduced motion.
Your JSX
<TypingIndicator
typing={false}
message="Ten minutes. I'm bringing the files."
tone="light"
autoplay={false}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| names | string[] | ["Maya"] | Who is typing. Drives the label and the avatars. An empty list shows the dots alone. |
| typing | boolean | — | Show the dots (true) or the message (false). Leave it out and the component runs by itself. |
| message | string | "Ten minutes. I'm bringing the files." | The message the bubble opens into when typing stops. |
| tone | "light" | "dark" | "light" | Colours for a light or a dark page. |
| autoplay | boolean | false | Alternates between typing and the message until the visitor touches it. Never runs under reduced motion. |
| className | string | "" | Extra classes for the outer element. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry
Run this once per project. It writes the Nexus UI entry into
components.jsonfor you:npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"Type it exactly as shown.
{name}is filled in by the CLI with the component you ask for, so you never replace it.
- 3
Add the component
Run this from your project root. It adds the component, the helpers it imports and its npm packages.
npx shadcn@latest add @nexus-labs/typing-indicator
- 4
Check what was added
With a project made as in the Quick Start (a
src/folder), these files land in it:components/typing-indicator/index.tstyping-indicator.tsx - 5
Copying by hand? Skip the registry
Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that
cn()exists. Install the packages:npm install framer-motion
Then show the source and create each file at the path it gives:
- 6
Use it in a page
Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:
// src/app/page.tsx import { TypingIndicator } from "@/components/typing-indicator"; export default function Page() { return ( <main> <TypingIndicator /> </main> ); }
Like Typing Indicator? 287 more are in Pro.
Pro unlocks all 287 Pro components, every template and block, and everything we release next. Typing Indicator stays free.
Typing Indicator questions
How do I install the typing indicator?
Run `npx shadcn@latest add @nexus-labs/typing-indicator`. It adds the component and installs framer-motion.
How do I control when it shows the dots?
Pass `typing` as true while the other person is typing and false when their message lands. Without `typing` the component runs by itself, and pressing the bubble switches it.
Can it show more than one person typing?
Yes. Pass several names and it stacks up to three avatars and writes "Maya and Leo are typing". The wave quickens a little with each extra person.
Is it accessible?
A polite live region announces who is typing and then the message. The animated bubble is hidden from screen readers so nothing is read twice, and it stays still under reduced motion.
Does it work in dark mode?
Set `tone="dark"` for dark bubbles and labels. Both tones use fixed colours, so they look the same whatever the page theme is.