Chat

Tabbed chat panel with reasoning replies and a composer.

Installation

pnpm dlx shadcn@latest add @ward/chat-composer

Add the Ward registry to components.json once:

"registries": {
  "@ward": "https://ward.so/r/{name}.json"
}

Or install from the URL with no configuration: npx shadcn@latest add https://ward.so/r/chat-composer.json

Usage

import ChatComposer from "@/components/ward/ChatComposer";
<ChatComposer
  suggestions={["Orders", "Customers"]}
  labels={{ initialPrompt: "Summarise last week's orders", placeholder: "Ask about orders" }}
  messages={[
    { label: "Orders", sub: "Database", time: "3s", body: "Found 412 orders from last week." },
    { label: "Summary", sub: "Analysis", time: "1s", body: "Revenue is up 6% on the week before." },
  ]}
  onSend={(text) => console.log(text)}
/>

Props

PropTypeDefaultDescription
variantstring"Default"Accepted for registry parity; ChatComposer has no visual variants.
messagesChatMessage[]MESSAGESScripted agent replies revealed in turn after the user sends; only the first two are shown.
suggestionsstring[]SUGGESTIONSTab labels in the header for switching context, with the first one selected.
labelsPartial<ChatComposerLabels>-Overrides for the pre-filled first prompt and the input placeholder.
onSend(text: string) => void-Called with the trimmed prompt text when the user sends.

Ward · Version 1.1.0 · Registry manifest