Skip to main content

Overview

@akapulu/react-ui is the higher-level React UI package in the Akapulu Web SDK. It is built on top of @akapulu/react and provides a prebuilt conversation interface for React apps.

Installation

Main export

The main export is AkapuluConversation.

Main responsibility

@akapulu/react-ui is responsible for rendering a ready-made conversation UI with:
  • video layout
  • transcript UI
  • loading and error states
  • current node display
  • tool event surfaces
  • built-in call controls

How it fits in your app

In a typical React app:
  1. AkapuluProvider from @akapulu/react points at your local routes.
  2. Your routes call Akapulu through @akapulu/server.
  3. AkapuluConversation renders the higher-level conversation UI on top of that session state.
See Customize Conversation UI for end-to-end setup (local connect/updates routes, connectBody, custom UI without this package, and post-call APIs).

When to use this package

Use @akapulu/react-ui when you want:
  • the fastest React integration
  • a prebuilt conversation UI
  • styling and rendering customization without building every surface from scratch
If you want complete control over layout and rendering, use @akapulu/react directly.

Minimal example

Styling AkapuluConversation

@akapulu/react-ui supports slot-level customization via:
  • className for the root
  • classes for slot class names
  • styles for slot inline style overrides

Example 1: Slot key overrides (classes + styles)

Use slot keys when you want to target specific UI parts directly from React props.

Example 2: Default class overrides (global CSS)

Use built-in default classes when you want to apply theme-like global styles from CSS.

Example 3: data-slot overrides (stable CSS selectors)

Use data-slot selectors when you want explicit, inspectable selectors in DevTools.

Slot map

Each slot has both a default class and a data-slot marker so users can inspect and target it in DevTools without guessing.

Layout

Loading

Error modal

Tool events

Video + controls

Transcript

Behavior customization (handlers + custom elements)

Beyond styles, @akapulu/react-ui lets you customize behavior and rendering for transcript and tool events directly on AkapuluConversation.

Built-in handler props on AkapuluConversation

  • transcriptFilter(entry) to hide transcript rows
  • renderTranscriptEntry(entry) to render transcript rows with your own JSX
  • onToolEvent(tool) to run side effects when a tool event arrives
  • renderToolEvent(tool) to replace the default tool toast element
  • toolEventTimeoutMs to control how long the tool toast stays visible
Callback signatures:
toolEventTimeoutMs behavior:
  • default: 4000
  • pass a number to customize the auto-hide timeout
  • pass null to disable auto-hide
TranscriptEntry shape (entry): NormalizedToolEvent shape (tool) by tool type:

RAG tool event

vision tool event

http tool event

Handling all conversation events while keeping prebuilt UI

For full event handling (node changes, bot speaking state, transcript updates, tool calls, and timeout), add a small sibling listener component that uses useAkapuluEvents from @akapulu/react.
Event schema by event.type:

status_changed

bot_speaking_state_changed

node_changed

tool_event

transcript_updated

call_ready

timeout

See Callbacks and events for more context on the event stream.