Skip to Content

Chat Response

Streaming AI response renderer for LLM output: splits fenced code into code blocks, sets inline backtick code in mono, and has a slot for a cursor at the end of the assistant's text.

Installation

pnpm dlx shadcn@latest add @01orbital/chat-response

Usage

import { ChatResponse } from "@/components/chat/chat-response"

const TEXT = `Install the block with the CLI:

\`\`\`bash
npx shadcn add @01orbital/three-plan-pricing-01
\`\`\`

It lands with its \`Button\` and \`Card\` dependencies resolved. Fenced code gets the pinned-dark surface; inline code stays mono with no pill.`

export default function ChatResponseDemo() {
  return (
    <div className="w-full max-w-xl">
      <ChatResponse className="text-sm/7 text-foreground" text={TEXT} />
    </div>
  )
}

This example installs with everything it uses:

pnpm dlx shadcn@latest add @01orbital/chat-response-demo

Examples

Reconciliation Answerchat-response-reconciliation-answer

Example of the Chat Response: an answer to a bookkeeping question under a large figure, on clean white.

pnpm dlx shadcn@latest add @01orbital/chat-response-reconciliation-answer

Telescope Runchat-response-telescope-run

Example of the Chat Response: a dark reply with a JSON block and inline code, headed by an observatory run label.

pnpm dlx shadcn@latest add @01orbital/chat-response-telescope-run

Release Reviewchat-response-release-review

Example of the Chat Response: a lilac release review combining inline code and a final status slot.

pnpm dlx shadcn@latest add @01orbital/chat-response-release-review

API reference

An assistant reply rendered from its text as it streams. Fenced code blocks become highlighted code panels; the prose around them stays plain, with inline code set in mono.

Prop

Type

Dependencies

npm: cn. The CLI installs it for you.

Requires these pieces. The CLI adds each one that is missing and won't replace a file you already have unless you choose to:

Used in blocks

7 blocks are built with Chat Response:

Last updated on