SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

On this page

TypingIndicator

The line under a conversation saying who is writing right now: three pulsing dots and "Mira is typing…".

Mira is typing…
Mira and Theo are typing…
3 people are typing…
View code
tsx
const LABELS: TypingIndicator.Labels = {
	one: (name) => `${name} is typing…`,
	two: (first, second) => `${first} and ${second} are typing…`,
	many: (count) => `${count} people are typing…`,
};

<div mix={[vstack({ gap: 3, align: "stretch" })]}>
	<TypingIndicator>{typingLabel(["Mira"], LABELS)}</TypingIndicator>
	<TypingIndicator>{typingLabel(["Mira", "Theo"], LABELS)}</TypingIndicator>
	<TypingIndicator>{typingLabel(["Mira", "Theo", "Kenji"], LABELS)}</TypingIndicator>
	<TypingIndicator />
</div>

Installation

An ordinary dependency: install it, import the theme once, and import the component where it is used.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
import { TypingIndicator } from "@sdxc/ui/chat";

Renders the status line. While it has text the dots pulse in turn; under reduced motion they hold still. Its role="status" announces each change once.

Props

Read from the component's own types, so every prop, every default and every allowed value is listed.

PropTypeRequiredDescription
childrenRemixNodeNoWhat is said, such as typingLabel(names, labels); empty while nobody types, which hides the dots and keeps the line's height.

Also accepts everything in TagProps<"div">.

Other components this module publishes.

  • typingLabel
@sdxc/ui

Can’t find it? Contact us