Blocks / Conversation list

Conversation list

Rows with avatars, presence, preview, time, unread, pinned and muted, under sections.

import { ConversationList, groupConversationItems, conversationListTime } from "@forgeron/ui";
/01 → Default
Léa MartinPinned09:41Can you review the PR?2 unread
Design08:10Sam: New icons are in14 unread, you are mentioned
Karim AzizYesterdaytyping…
Ops alertsMutedSunBuild 214 passed5 unread
import { ConversationList, type ConversationListItem } from "@forgeron/ui";
import { useState } from "react";

const items: ConversationListItem[] = [
  {
    id: "1",
    title: "Léa Martin",
    people: ["Léa Martin"],
    presence: "online",
    preview: "Can you review the PR?",
    at: "2026-11-19T09:41:00Z",
    unread: 2,
    pinned: true,
  },
  {
    id: "2",
    title: "Design",
    people: ["Sam Roche", "Jo Bernard", "Karim Aziz"],
    preview: "New icons are in",
    previewAuthor: "Sam",
    at: "2026-11-19T08:10:00Z",
    unread: 14,
    mention: true,
  },
  {
    id: "3",
    title: "Karim Aziz",
    people: ["Karim Aziz"],
    presence: "away",
    typing: true,
    at: "2026-11-18T17:00:00Z",
  },
  {
    id: "4",
    title: "Ops alerts",
    people: ["Ops"],
    preview: "Build 214 passed",
    at: "2026-11-15T10:00:00Z",
    muted: true,
    unread: 5,
  },
];

export default function Default() {
  const [selected, setSelected] = useState<string | null>("1");
  return (
    <div style={{ width: "100%", maxWidth: 380, border: "1px solid var(--line-strong)" }}>
      <ConversationList
        items={items}
        selectedId={selected}
        onSelect={setSelected}
        now="2026-11-19T12:00:00Z"
        timeZone="UTC"
      />
    </div>
  );
}
/02 → Sections
# opsPinned07:00Deploy done
# general09:55Standup in 51 unread
Léa MartinYesterdayBack at 14:00
Sam Roche10 NovThanks!
import { ConversationList, type ConversationListItem } from "@forgeron/ui";
import { useState } from "react";

const items: ConversationListItem[] = [
  {
    id: "1",
    title: "# general",
    section: "channels",
    preview: "Standup in 5",
    at: "2026-11-19T09:55:00Z",
    unread: 1,
  },
  {
    id: "2",
    title: "# ops",
    section: "channels",
    preview: "Deploy done",
    at: "2026-11-19T07:00:00Z",
    pinned: true,
  },
  {
    id: "3",
    title: "Léa Martin",
    section: "direct",
    people: ["Léa Martin"],
    presence: "busy",
    preview: "Back at 14:00",
    at: "2026-11-18T12:00:00Z",
  },
  {
    id: "4",
    title: "Sam Roche",
    section: "direct",
    people: ["Sam Roche"],
    presence: "offline",
    preview: "Thanks!",
    at: "2026-11-10T12:00:00Z",
  },
];

export default function Sections() {
  const [selected, setSelected] = useState<string | null>(null);
  return (
    <div style={{ width: "100%", maxWidth: 380, border: "1px solid var(--line-strong)" }}>
      <ConversationList
        items={items}
        selectedId={selected}
        onSelect={setSelected}
        sections={[
          { id: "channels", label: "Channels" },
          { id: "direct", label: "Direct messages" },
        ]}
        now="2026-11-19T12:00:00Z"
        timeZone="UTC"
      />
    </div>
  );
}
API → Props
PropTypeDefaultDescription
itemsConversationListItem[]—{ id, title, people?, avatar?, presence?, preview?, previewAuthor?, at? | time?, unread?, mention?, pinned?, muted?, typing?, section? }.
selectedId / onSelectstring | null; (id) => void—The one open; click, Enter and Space choose.
sections{ id, label }[]—Headings, in order; an item picks one with section.
pinnedLabelstring | false"Pinned"Pinned items sit in a section above the rest.
restLabelstring"All"The heading of the rest under the pinned ones, when there are no sections.
now / timeZone / label / emptystring; string; string; ReactNode—Times are written as 09:41, Yesterday, Mon, 16 Nov.
classNamestring—Extra classes.