# Chat Thread

> Complete chat transcript: user bubbles, assistant replies with code blocks and a streaming caret, hover actions (copy, rate, regenerate), scroll pinning with a jump-to-latest pill and an auto-growing composer.

- Slug: `chat-thread`
- Category: [AI chat](https://assembli-rho.vercel.app/category/ai-chat.md)
- Type: block
- Tags: chat, streaming, messages, composer
- npm dependencies: motion, lucide-react
- shadcn/ui dependencies: none
- Added: 2026-10-15
- Live preview: https://assembli-rho.vercel.app/preview/chat-thread
- Page: https://assembli-rho.vercel.app/components/chat-thread

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://assembli-rho.vercel.app/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://assembli-rho.vercel.app/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/chat-thread/chat-thread.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/chat-thread
```

Registry item JSON: https://assembli-rho.vercel.app/r/chat-thread.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://assembli-rho.vercel.app/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://assembli-rho.vercel.app/api/agent/token for the key. Or subscribe at https://assembli-rho.vercel.app/pricing and create a key at https://assembli-rho.vercel.app/account.
