Typing indicator and presence
Who is writing, in a polite live region, and whether someone is there.
import { TypingIndicator, PresenceDot, conversationTypingLabel } from "@forgeron/ui";Léa is typing…
Léa and Karim are typing…
Léa, Karim and 2 others are typing…
OnlineAwayBusyOffline
import { PresenceDot, TypingIndicator } from "@forgeron/ui";
export default function Default() {
return (
<div style={{ display: "grid", gap: 12 }}>
<TypingIndicator names={["Léa"]} />
<TypingIndicator names={["Léa", "Karim"]} />
<TypingIndicator names={["Léa", "Karim", "Sam", "Jo"]} />
<div style={{ display: "flex", gap: 20 }}>
<PresenceDot status="online" showLabel />
<PresenceDot status="away" showLabel />
<PresenceDot status="busy" showLabel />
<PresenceDot status="offline" showLabel />
</div>
</div>
);
}API → Props
| Prop | Type | Default | Description |
|---|---|---|---|
names | string[] | — | TypingIndicator: who is writing; empty keeps the line, silent. |
shown / reserve | number; boolean | — | Names written before “and n others” (2); keep the line height (true). |
status | "online" | "away" | "busy" | "offline" | — | PresenceDot: a square, never a circle, and a word. |
label / showLabel | string; boolean | — | PresenceDot: another word; write it next to the square. |
className | string | — | Extra classes. |