Chat timeline
<ChatTimeline />A rail down the side of a long conversation: a bead rolls to the turn being read, and each mark jumps to its turn.
Install
bash
npx shadcn@latest add https://orbeez-kit.vercel.app/r/chat-timeline.jsonUsage
tsx
<ChatContainer>
<ChatContainerContent>
{turns.map((t) => (
<Message key={t.id} from="user" data-timeline={t.id}>…</Message>
))}
</ChatContainerContent>
<ChatTimeline items={turns.map((t) => ({ id: t.id, label: t.prompt, mood: t.mood }))} />
</ChatContainer>Good to know
- Moods. The bead on the rail wears the mood of the turn you're reading: working while it runs, sad if it was stopped.
- Mark each turn with data-timeline={id}; the rail finds them inside its ChatContainer.
- Hover or focus a mark to see what was asked there. A jump lets go of the bottom, as scrolling up would.
- It floats over the column and moves only by transform. With more turns than fit, the marks close up rather than the rail growing.
- Leave room on the right of the column for it, or hide it on narrow screens.