Introduction
@threadplane/angular/chat is the Angular UI component library for building chat interfaces on top of one backend-neutral Agent. It is a set of composable, Signal-driven components that render messages, handle user input, display tool calls, manage interrupts, and support generative UI -- all styled with CSS custom properties and built for Angular 20–22.
This guide explains the library's two-tier architecture, how it relates to the rest of the Threadplane stack, and when to reach for the all-in-one composition versus assembling primitives yourself.
Build one conversation surface
Imagine a trip planner: the traveler enters a destination, watches an answer arrive, opens a weather result, and changes an itinerary. Start with the composition for the ordinary conversation. Reach for individual primitives when the itinerary, tool result, or approval needs a different place in the page.
The component tree does not own the agent's reasoning loop or persistence. It renders the current conversation and sends user actions to the agent. Follow a conversation explains that boundary from the first request to a saved thread.
How it fits
Read diagram description
Read from top to bottom. The Angular chat composition and its message-list and input primitives read one Agent from @threadplane/angular: the snapshot fields of an AgentSession as signals, plus the session's commands. The session contract is defined in @threadplane/core, and two packages create a session that meets it. createSession() from @threadplane/langgraph connects to LangGraph Platform. createSession() from @threadplane/ag-ui connects to AG-UI backends such as CrewAI, Mastra, Microsoft Agent Framework and AWS Strands. Changing the session package does not require replacing the chat components.
Two-Tier Architecture
The library is organized into two layers: primitives and compositions.
Primitives
Primitives are low-level, headless components that read from an Agent and expose their state through content projection (ng-template). Template primitives let you provide the rendered content. Other primitives, including the input and tool-call controls, include their own interaction and styling. Compose the pieces when you need control over the surrounding layout or message presentation.
| Primitive | Selector | Purpose |
|---|---|---|
ChatMessageListComponent | chat-message-list | Iterates messages and renders via template directives |
MessageTemplateDirective | ng-template[chatMessageTemplate] | Declares a template for a specific message type |
ChatInputComponent | chat-input | Text input with submit handling and keyboard shortcuts |
ChatTypingIndicatorComponent | chat-typing-indicator | Animated dots shown while the agent is streaming |
ChatErrorComponent | chat-error | Displays error messages from the agent |
ChatInterruptComponent | chat-interrupt | Projects interrupt content via a template |
ChatToolCallsComponent | chat-tool-calls | Iterates tool calls and projects each via a template |
ChatSubagentsComponent | chat-subagents | Iterates the agent's child agents via a template |
ChatThreadListComponent | chat-thread-list | Renders a list of conversation threads |
ChatTimelineComponent | chat-timeline | Iterates checkpoint history via a template |
Compositions
Compositions are opinionated, styled components that combine primitives into ready-to-use UI blocks. They apply the --tplane-chat-* token system automatically and include markdown styling where needed.
| Composition | Selector | Purpose |
|---|---|---|
ChatComponent | chat | Full chat UI with messages, input, typing indicator, error, and thread sidebar |
ChatInterruptPanelComponent | chat-interrupt-panel | Styled interrupt card with accept/edit/respond/ignore actions |
ChatToolCallCardComponent | chat-tool-call-card | Expandable card showing tool name, inputs, and output |
ChatSubagentCardComponent | chat-subagent-card | Expandable card showing subagent status and messages |
ChatDebugComponent | chat-debug | Debug panel from @threadplane/angular/chat/debug with timeline, state inspector, and diff viewer |
ChatTimelineSliderComponent | chat-timeline-slider | Slider-based timeline navigation |
How the Stack Fits Together
@threadplane/angular/chat sits between your application and the backend session below the Agent seam shown above; alongside it, @threadplane/angular/render turns specs in assistant messages into your components.
-
@threadplane/angularprovidesprovideAgent()andinjectAgent(). The injectedAgentis a session's snapshot fields as Signals (messages(),status(),error(),toolCalls()andstate(), plus the optionalinterrupts(),subagents(),plan()andcheckpoints()) and the session's commands (submit,stop, and the optionalresume,retryandregenerate). A field the backend does not report reads asundefined, and a command it does not offer isundefined. -
@threadplane/langgraphand@threadplane/ag-uieach exportcreateSession(), which runs a backend behind the framework-neutralAgentSessioncontract from@threadplane/core. You hand that factory toprovideAgent({ createSession }). A backend can publish more than the core contract: a LangGraph session addshistory(),fork()and branch data for checkpoint time-travel. -
@threadplane/angular/renderprovidesRenderSpecComponentand view registries for rendering JSON UI specs as Angular components. TheChatComponentauto-detects JSON specs in AI messages and renders them through@threadplane/angular/render- pass a view registry via the[views]input. A2UI rendering takes a separate[a2ui]input: passa2uiRenderer()from@threadplane/angular/a2ui, whose defaulta2uiBasicCatalog()currently maps 18 component types.
When to Use ChatComponent vs. Custom Assembly
Use ChatComponent when you want a complete, styled chat interface with minimal setup. It includes message rendering (with markdown), a text input, typing indicator, error display, and an optional thread sidebar. Interrupt UI is not part of it — compose <chat-interrupt-panel> yourself when your runtime pauses for input. Drop it in, pass an Agent, and you have a working chat.
<chat [agent]="chatRef" />Assemble primitives when you need to customize layout, add components between sections, change the message rendering logic, or integrate chat into a larger dashboard. Choose headless template primitives where you need custom markup, and styled primitives where their interaction matches your product.
<chat-message-list [agent]="chatRef">
<ng-template chatMessageTemplate="human" let-message>
<!-- your custom user message layout -->
</ng-template>
<ng-template chatMessageTemplate="ai" let-message>
<!-- your custom assistant message layout -->
</ng-template>
</chat-message-list>
<chat-input [agent]="chatRef" placeholder="Ask anything..." />What's Next
Install the package, check the peer dependencies, and provide an agent.
Get a working chat UI running in under 5 minutes.
Customize colors, fonts, and spacing with CSS custom properties.
Subscribe to per-instance lifecycle signals via CHAT_LIFECYCLE.