Skip to content
Browse library
BIU UI/Components/AI Message
COMPONENTS

AI Message

Explore the AI Message component and try its interactive examples.

INTERACTIVE PREVIEW

Preview

Install the components for this example with pnpm dlx shadcn add @biudev/ai-message @biudev/thinking-state.

Loading preview…
GET STARTED

Installation

Install the component source via shadcn Registry, the BIU CLI, or as an npm package.

TERMINAL / pnpm
pnpm dlx shadcn add @biudev/ai-message

First time using @biudev? Map "@biudev": "https://ui.biu.dev/r/0.1.0/{name}.json" under registries in your components.json (see setup).

Usage

Start with this example, then adjust the import path for your project.

EXAMPLE / TSX
import { AiMessage } from "@/components/ui/biu/ai-message";

export function Example() {
  return (
    <AiMessage
      author="Claude Sonnet 4"
      content="Edge caching cut median latency by 42% [1]."
      citations={[{ id: 1, title: "Q3 Rollout Report", url: "https://linear.app", domain: "linear.app" }]}
      onRetry={() => {}}
    />
  );
}

Examples

Try each example or switch to its code.

API reference

Properties and defaults from the component source. An asterisk marks a required property; a dash means no explicit default.

AiMessageRole

Also accepts properties from 'user' & 'assistant' & 'system'.

Some properties depend on the variant; consult the source for the full union.

AiFeedbackValue

Also accepts properties from 'up' & 'down' & null.

Some properties depend on the variant; consult the source for the full union.

AiCitation

AiMessageBranch

AiMessageLabels

InlineCitationProps

MessageSourcesProps

AiMessageProps

Source

Review a formatted version of the component source used by the Registry.