Expand description
A configurable Dioxus + Bulma chat UI.
The crate provides a ChatSurface component plus a small data model
(ChatTranscript, ChatMessage, ChatMessagePayload) for rendering
chat conversations, including:
- chained, collapsible reasoning timelines (
Reasoning), - inline message controls — buttons, selectors, toggles (
InlineControl), surfaced throughChatSurface’son_actionhandler, - spinning status indicators, tool calls, progress, and errors.
The composer is controlled: bind ChatSurfaceProps::input and handle
on_send/on_stop/on_retry/on_clear. Set ChatSurfaceProps::embedded
to host the surface inside an app that already provides Bulma and a theme,
and inject app-specific composer controls via
ChatSurfaceProps::input_accessory.
With the default genai feature enabled, ChatTranscript::to_genai_request
converts a transcript into a genai chat request. Disable default features
to build for wasm32-unknown-unknown (the web target), where genai is not
available. The markdown feature (on by default, pure Rust) renders
ChatMessagePayload::Markdown to HTML.
Structs§
- Chat
Controls - Chat
Message - Chat
Surface Props - Chat
Transcript - Context
Item - A piece of context (a file or directory) attached to the next message.
- Control
Event - Emitted when the user interacts with an
InlineControl. - Diff
Line - A single line within a unified
FileDiff. - Document
- A document shown as a thumbnail that expands to a full view on click.
- File
Diff - A unified diff for a single file, rendered with an apply animation.
- Progress
State - Reasoning
- A collapsible group of chained reasoning steps shown as a connected timeline.
- Reasoning
Step - A single phase in a chained “thinking” trace (à la VS Code agent steps).
- Select
Option - An option in an inline
InlineControl::Select. - Tool
Call
Enums§
- Chat
Message Payload - Chat
Role - Context
Event - Emitted when the user adds or removes context via the input area.
- Context
Kind - Whether a piece of attached context is a file or a directory.
- Control
Style - Visual emphasis for an inline control.
- Control
Value - The kind of interaction that produced a
ControlEvent. - Diff
Kind - The role of a single line in a
FileDiff. - Document
Event - Emitted when the user acts on documents in a gallery.
- Document
Kind - The type of a
Document, used to pick an icon when there is no image preview. - Inline
Control - A small interactive element rendered inline inside a message.
- Step
Status - Lifecycle of a single step inside a chained reasoning trace.
- Tool
Call Status