A whole chat screen: conversations with ⌘K search, a thread with thinking and answers, model picker, approvals inline, a side panel and a composer. It folds into sheets on narrow screens.
This page holds the props and the code. See the template, its screens and a live preview.
On this page
Examples
Installation
Installation is part of Pro
Pro components install from a licensed registry. The live preview stays open to everyone.
Props
- conversations / activeId
{ id, title, updatedAt }[] / string|null- Sidebar list, newest first, grouped Today / Yesterday / Earlier. An unknown or null id shows a new chat (the empty screen).
- onSelectConversation / onNewChat
(id) => void / () => void- Also reachable from search (⌘K) and, on narrow screens, from the sheet.
- onHome
() => void- Makes the brand at the top of the sidebar a button that goes home, e.g. to a new chat.
- onRenameConversation / onDeleteConversation
(id, title) => void / (id) => void- From each row's ⋯ Menu. Rename edits inline (Enter keeps, Esc cancels); delete asks to confirm. nextAfterDelete(list, id) picks where to go.
- messages
ChatMessage[]- User: { id, role, text, attachments? }. Assistant: { id, role, text, status, sources?, thinking?, permission?, suggestions?, meta?, error? }.
- thinking
{ steps, status, elapsed?, startedAt?, endedAt?, reasoning? }- ThinkingState above the answer while it works, then folded to "Thought for 6s". The right panel shows it in full with the reasoning.
- permission / onPermission
ChatPermission / (messageId, decision, scope) => void- PermissionRequest inline in the turn (Enter allows, Esc denies). Set permission.decision to show the receipt.
- busy / onSend / onStop
boolean / (ComposerMessage) => void / () => void- ChatComposer at the bottom; send becomes Stop while busy. Attachments come back from onAttach(kind).
- onRegenerate / onFeedback / onCopy
(messageId, …) => void- AiAnswer actions. Regenerate and follow-up suggestions show on the last answer only.
- assistantAvatar
({ message, last, busy }) => ReactNode- Default
the spark - The face beside each assistant turn. Gets the message, so a character can think while the answer is on its way and look worried when it failed.
- models / model / onModelChange
ModelOption[] / string / (id) => void- ModelPicker in the header; below 560px the composer's model chip takes over.
- suggestions / emptyTitle / emptyDescription
(string | { title, description?, prompt?, icon? })[] / ReactNode- Default
[] / "What can I help with?" - Empty screen: the NoRuns illustration and prompt tiles. Picking a tile sends it.
- panel / panelTitle / defaultPanelOpen
ReactNode|false / string / boolean- Default
latest turn details / "Run details" / false - Right panel: pass an AgentMonitor bound to your run, or false to remove it.
- brand / sidebarFooter / commands
ReactNode / ReactNode / CommandItem[]- Sidebar top and bottom, and extra actions in the search menu.
- hotkey
string|false- Default
"mod+k" - Opens search from anywhere. Turn it off if your app already uses the combo.
- height / defaultSidebarCollapsed
number|string / boolean- Default
720 / false - Collapsed, the sidebar is a rail (new chat, search, expand).
- Layout
container queries- From the block's own width: ≥1100px sidebar, thread and panel; ≥760px sidebar and thread with the panel as a sheet; below that the sidebar is a sheet too.
| Prop | Type | Default | Description |
|---|---|---|---|
| conversations / activeId | { id, title, updatedAt }[] / string | null | - | Sidebar list, newest first, grouped Today / Yesterday / Earlier. An unknown or null id shows a new chat (the empty screen). |
| onSelectConversation / onNewChat | (id) => void / () => void | - | Also reachable from search (⌘K) and, on narrow screens, from the sheet. |
| onHome | () => void | - | Makes the brand at the top of the sidebar a button that goes home, e.g. to a new chat. |
| onRenameConversation / onDeleteConversation | (id, title) => void / (id) => void | - | From each row's ⋯ Menu. Rename edits inline (Enter keeps, Esc cancels); delete asks to confirm. nextAfterDelete(list, id) picks where to go. |
| messages | ChatMessage[] | - | User: { id, role, text, attachments? }. Assistant: { id, role, text, status, sources?, thinking?, permission?, suggestions?, meta?, error? }. |
| thinking | { steps, status, elapsed?, startedAt?, endedAt?, reasoning? } | - | ThinkingState above the answer while it works, then folded to "Thought for 6s". The right panel shows it in full with the reasoning. |
| permission / onPermission | ChatPermission / (messageId, decision, scope) => void | - | PermissionRequest inline in the turn (Enter allows, Esc denies). Set permission.decision to show the receipt. |
| busy / onSend / onStop | boolean / (ComposerMessage) => void / () => void | - | ChatComposer at the bottom; send becomes Stop while busy. Attachments come back from onAttach(kind). |
| onRegenerate / onFeedback / onCopy | (messageId, …) => void | - | AiAnswer actions. Regenerate and follow-up suggestions show on the last answer only. |
| assistantAvatar | ({ message, last, busy }) => ReactNode | the spark | The face beside each assistant turn. Gets the message, so a character can think while the answer is on its way and look worried when it failed. |
| models / model / onModelChange | ModelOption[] / string / (id) => void | - | ModelPicker in the header; below 560px the composer's model chip takes over. |
| suggestions / emptyTitle / emptyDescription | (string | { title, description?, prompt?, icon? })[] / ReactNode | [] / "What can I help with?" | Empty screen: the NoRuns illustration and prompt tiles. Picking a tile sends it. |
| panel / panelTitle / defaultPanelOpen | ReactNode | false / string / boolean | latest turn details / "Run details" / false | Right panel: pass an AgentMonitor bound to your run, or false to remove it. |
| brand / sidebarFooter / commands | ReactNode / ReactNode / CommandItem[] | - | Sidebar top and bottom, and extra actions in the search menu. |
| hotkey | string | false | "mod+k" | Opens search from anywhere. Turn it off if your app already uses the combo. |
| height / defaultSidebarCollapsed | number | string / boolean | 720 / false | Collapsed, the sidebar is a rail (new chat, search, expand). |
| Layout | container queries | - | From the block's own width: ≥1100px sidebar, thread and panel; ≥760px sidebar and thread with the panel as a sheet; below that the sidebar is a sheet too. |
When to use
When to use
- Starting a complete chat product: sidebar with search and chats by day, thread with thinking, approvals and cited answers.
- Internal agents and assistants where a familiar chat layout lowers the learning curve.
When not to use
- Adding one answer to an existing page: use AI Answer.
- Operations views where the run matters more than the conversation: use Agent Ops Dashboard.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Chat App to my app and wire it to my own data.
- I need starting a complete chat product: sidebar with search and chats by day, thread with thinking, approvals and cited answers. Set that up with the Knowns UI Chat App.
- Which Chat App props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "screen-chat" }) and search_docs({ query: "chat app" }). Pro props, full examples and source come back once your license key is in the MCP config.