Skip to content
DocsStar33Playground

Frontend & UI

ExplanationUnstableLast updated 2026-12-03 · da74202ecQuickstart

Reactive Agents ships frontend building blocks in four packages. The headless core, @reactive-agents/ui-core, owns the wire protocol, the resumable stream client and the run state machine. The bindings for React, Vue and Svelte are thin glue on top of it. Drop-in components (composer, cards, toasts and more) come from the same bindings.

All four packages are labelled unstable in the stability reference: they can change in any release. Pin versions.

I want Go to
A chat input (send, queue, stop, file drop, slash commands) Composer and Slash Menu
To stream an agent into React, Vue or Svelte Web Integration
Ready-made approval and question cards, a settings form shell Cards and Config Shell
Toasts, tooltips, long windowed lists Lists, Tooltips and Toasts
A context-window gauge, chart, findings, or markdown rendering Context Window Views and Markdown
Headless state only, my own components Agentic UI Core
The React or Vue component set React Drop-in Blocks, Vue Drop-in Blocks
An end-to-end Next.js example Add an AI Agent to a Next.js App
To see a finished app that uses all of this Cortex Studio, the reference app (its chat UI is described in Chat and composer)

Two server-side topics sit outside this group because they are not frontend code. Streaming covers agent.runStream() and the SSE adapter your route handler calls. Chat & Sessions covers agent.chat() and agent.session() for multi-turn memory.

The shape is the same everywhere. Each step links to the page that holds the full code.

  1. Server. A route handler builds an agent and returns AgentStream.toSSE(agent.runStream(prompt)). See the server setup in Web Integration.

  2. Client state. Install your binding and read agent state from one call:

    • React: useAgentStream or useAgent from @reactive-agents/react
    • Vue: useAgentStream or useAgent from @reactive-agents/vue
    • Svelte: createAgentStream or createAgent from @reactive-agents/svelte

    Each exposes the streamed text, a status and a run function. For a run that pauses on an approval or survives a reload, use useRun (React, and Vue from 0.20.1) or createRun (Svelte). Examples per framework are in Web Integration.

  3. Components. Import the stylesheet once (@reactive-agents/<framework>/styles.css), map the --ra-* variables to your theme, and import blocks from @reactive-agents/<framework>/components. The components own no store and make no request: you pass state down and handle events. Start with the Composer.

All names below were checked against each package’s src/index.ts and subpath exports on 2026-12-02.

Package Role Main exports
@reactive-agents/ui-core Headless, Effect-free, browser-safe core Wire protocol types, connectRunStream, initialRunState and reduceRunState, turn-trace and status helpers, cost and time formatters, uiTreeSchema, fetchInbox, a ./testing subpath
@reactive-agents/react React 18+ binding Hooks useAgentStream, useAgent, useRun, useResumableRun, useInteractions, useTaskInbox, useRunCost, useRunSteps; blocks AgentPrompt, ChoiceCard, ApprovalGate, TaskInbox, CostMeter, StepTimeline, AgentSurface, AgentDevtools; subpaths ./components, ./markdown, ./styles.css, ./testing
@reactive-agents/vue Vue 3.2+ binding Composables useAgentStream, useAgent, useStructuredObject; from 0.20.1 useRun, useResumableRun, useInteractions, useTaskInbox, useRunCost, useRunSteps; subpaths ./components, ./markdown, ./styles.css
@reactive-agents/svelte Svelte binding (stores work on Svelte 4+; the components are Svelte 5) Stores createAgentStream, createAgent, createStructuredStream, createRun, createResumableRun, createInteractions, runCost, runSteps; subpaths ./components, ./markdown, ./styles.css, ./testing

All three binding roots export the run, resumable-run and interaction rails (durable human-in-the-loop). The Vue root has them from 0.20.1, which also raised its peer floor to Vue 3.2; the reference and an approval example are in Durable-run composables. The Svelte root has no inbox store; call fetchInbox from ui-core there.

Markdown rendering lives on its own ./markdown subpath because it needs optional peer dependencies.

Piece Status
Token streaming hooks, composables and stores (React, Vue, Svelte) Shipped, unstable
ui-core protocol, resumable streams, run state machine, fixture testing Shipped, unstable
Drop-in blocks: Composer, SlashMenu, approval and question cards, config shell, toasts, tooltips, virtual list, context views, run controls Shipped, unstable. Svelte, React and Vue sets share props, labels and data-ra-* hooks
Chat bundle: a ready-made thread view, session list and endpoint adapter Planned, not shipped. Today you compose a chat UI from the Composer, the run state and your own message list, as Cortex does

The direction is that an app with its own chat can adopt the ui-core state and the drop-in blocks it wants without rebuilding them. Treat that as direction, not a guarantee: only the shipped rows above are supported today.

Install

Bun (recommended)bun add reactive-agents
Node 22.5+npm install reactive-agents

Get notified on new releases

Release notes, about once a month.