Expand description
AI-native UI components for GPUI applications.
Composed, opinionated components for the surfaces an AI application keeps
rebuilding — streaming text, thinking traces, tool calls, approval gates —
built on [gpui_component] and inheriting its semantic-token theming.
Every component resolves all of its presentation through the active theme,
so light/dark modes, bundled themes, and custom JSON themes work without
extra wiring.
§Design rules
- Stateless components are fluent [
gpui::RenderOnce] builders; stateful composites are entities. Callbacks useon_*methods. - Progressive output flows through one model:
stream::StreamedContent. Components render snapshots; applications own the state and the clock. - No component runs a clock over the state it is given, or keeps fixture data. A component may time something it alone owns — a “Copied” confirmation clearing itself — but nothing a snapshot describes is ever advanced from inside.
Further components land phase by phase; see the repository roadmap.
Modules§
- approval
- Human-in-the-loop approval gates for agent actions.
- artifact
- Artifact side panel: a generated document, code file, or data view shown beside the conversation.
- attachment
- Attachment previews: the files a person adds to a prompt and the files a message carries.
- chat
- Controlled, virtualized chat transcript composed from gpui-ai primitives.
- chip
- Compact chips representing tool calls and code edits.
- code_
block - Syntax-highlighted code blocks with streaming reveal.
- code_
diff - Code diff viewer: a unified patch as reviewable hunks.
- command_
search - Stable-ID command search composed over gpui-component’s native command palette.
- comparison_
table - Bounded, feature-oriented comparison table values and presentation.
- context_
card - Cards for retrieved knowledge chunks with source attribution.
- context_
meter - Context-window usage: how much of the model’s window a conversation has consumed, as a ring, a bar, or plain text, with a hover breakdown.
- cues
- Interaction cues: the moments an application may want to mark with a sound, haptic, or notification.
- decoration
- Layers an application paints into a component’s frame.
- diff_
table - Controlled before/after proposals for tabular data.
- filter_
table - Controlled filter-table values and animated stable-row presentation.
- fine_
tune - Controlled fine-tune inspector for design properties.
- form
- The controls a person answers with: one choice from a set, and one switch between two states.
- image_
generation - Progressive reveal for image generation.
- insight
- Paged analytical insight cards with metrics and a time series.
- loading
- An animated pixel-grid loading state with optional elapsed time.
- motion
- Motion primitives shared by gpui-ai components.
- orbs
- An ambient, always-moving indicator for “the model is alive” moments.
- plan
- Plan cards: an agent’s proposed steps as one reviewable card.
- popup
- Where transient surfaces open, how soon, and what edge they draw.
- prelude
- Convenient single-import surface:
use gpui_ai::prelude::*;. - prompt_
bar - Hybrid-controlled prompt composition with native GPUI text editing.
- question_
flow - A short sequence of questions an agent asks before it acts.
- queue
- Message queue: prompts waiting their turn while the agent is busy.
- recommendation
- Agent suggestion cards with confidence and alternatives.
- records_
table - Controlled record-grid values and presentation.
- scrolling
- Scroll behavior primitives: wheel acceleration and middle-click autoscroll.
- search_
results - Web-search tool output: a query and its results with sources.
- selection_
actions - Selection-anchored actions for readable Markdown content.
- sidebar_
nav - Stable-ID, filterable navigation composed over gpui-component’s Sidebar primitives.
- sizing
- Semantic size policy: control heights and leading glyph slots.
- status
- One status vocabulary for every lifecycle the library displays.
- stream
- Shared lifecycle and revision tracking for progressively arriving content.
- streaming_
text - Streamed markdown answers with sources and follow-up suggestions.
- suggestions
- Suggestion chips: starter prompts and follow-ups as one quiet row.
- task
- Live status rows for progressive agent tasks.
- thinking
- Expandable progressive reasoning traces.
- thread_
list - Conversation list: new, switch, rename, archive, delete, and search.
- todo_
list - Agent plan display: a to-do list with live completion status.
- tool_
call - Collapsible tool-call cards and the group that folds a burst of them.
- voice
- Voice controls: dictation and speech as typed intent.
Traits§
- Button
Label Ext - Adds a text label with the theme’s leading rather than a one-em line box.
Functions§
- init
- Initializes gpui-ai.