dioxus-genai-chat
A configurable Dioxus + Bulma
chat UI: a ChatSurface component plus a small transcript data model.
Features
- Chained reasoning timelines — collapsible, VS Code-style "thinking" steps with status markers and a connecting line.
- Controlled composer — bind
inputand handleon_send/on_stop/on_retry/on_clear; Enter sends, Shift+Enter inserts a newline. - Inline controls — buttons, selectors, and toggles rendered inside messages,
surfaced through a single
on_actionevent handler (controlled-component style). - Markdown rendering —
Markdownpayloads render to formatted HTML (markdownfeature, on by default). - Embeddable —
embedded: truedrops the standalone page chrome (no self-loaded Bulma, noSection/Box/title) so the surface fits inside a host app that already provides Bulma and a theme. - Composer accessory slot — inject app-specific controls (a model picker, a
directory selector, …) into the input area via
input_accessory. - Spinning status indicators — pure-CSS spinners for in-progress work; tool calls, progress bars, and error states.
genaiintegration — convert a transcript into agenaichat request (optional, on by default).- Theme-aware styling — scoped CSS driven by Bulma CSS variables.
Install
[]
= "0.2"
For a wasm32-unknown-unknown (web) build, disable default features — genai
pulls in tokio networking that does not compile on wasm (the markdown
feature is pure Rust and safe to keep):
[]
= { = "0.2", = false, = ["markdown"] }
Usage
use *;
use ;
The composer, transcript, attachments, and inline controls are all controlled: the surface renders what you pass and emits events; you own the state and update it in response.
With the default genai feature, ChatTranscript::to_genai_request() turns a
transcript into a genai::chat::ChatRequest.
License
Licensed under the MIT license.