App, assistant thread


Install
npx shadcn add @klarhimmel/app-assistant-threadDetailsAbout, usage, props and more
A conversation with an assistant: drawn as the agent chat kit draws it (the person in a bubble on the right, the reply as plain text, no avatars or visible names)…
Import
Import
- app/assistant-thread
- About
- A conversation with an assistant: drawn as the agent chat kit draws it (the person in a bubble on the right, the reply as plain text, no avatars or visible names), optional code, sources and a note under a turn (a staff correction), and…
- Category
- Interface sections for signed-in products. New project? Set it up once: /get-started/installation.
Notes
When to use it
The message log of an assistant: user and assistant turns, optional code, and idle, streaming, error and empty states. Use app-assistant-showcase when you only want a picture of a conversation on a landing page.
Writing for it
- Each turn takes text up to 4000 characters and an optional code up to 20000. Put commands and file contents in code so they get their own scrollable, labelled region instead of running into the prose.
- Names matter: userName and assistantName (30 characters) name each turn for a screen reader, and the user's avatar shows the first letter of the name.
- For the empty state, give up to 3 suggestions of 80 characters as full questions someone would actually ask, since each becomes a button.
Watch out for
With height set to fixed the log scrolls inside the block at about 28rem and takes focus from the keyboard, so a fixed thread inside a page with other scrolling content can trap people. Suggestion and Retry buttons do nothing until a host passes handlers.
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | 'Name who the conversation is with' | Text, up to 60 characters. |
state | 'idle' | 'streaming' | 'error' | 'empty' | 'idle' | One of 'idle', 'streaming', 'error', 'empty'. |
height | 'auto' | 'fixed' | 'auto' | One of 'auto', 'fixed'. |
userName | string | 'You' | Text, up to 30 characters. |
assistantName | string | 'Assistant' | Text, up to 30 characters. |
turns | { role, text, code, sources, note }[] | 3 items | List of up to 50. Each item: role ('user' | 'assistant'), text, code (optional), sources (optional), note (optional). |
sourcesLabel | string | - | Text, up to 30 characters. Optional; empty is not rendered. |
codeLabel | string | 'Code' | Text, up to 30 characters. |
typing | string | 'Writing…' | Text, up to 40 characters. |
error | { title, message, retry } | {…} | Fields: title, message, retry. |
empty | { title, hint, suggestions } | {…} | Fields: title, hint, suggestions. |