Blocks / Typing indicator and presence

Typing indicator and presence

Who is writing, in a polite live region, and whether someone is there.

import { TypingIndicator, PresenceDot, conversationTypingLabel } from "@forgeron/ui";
/01 → Default
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
PropTypeDefaultDescription
namesstring[]—TypingIndicator: who is writing; empty keeps the line, silent.
shown / reservenumber; 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 / showLabelstring; boolean—PresenceDot: another word; write it next to the square.
classNamestring—Extra classes.