AI Elements
Patterns for agentic interfaces, composed from rightui components.
Built from shared components
Copy a pattern into your Exact project and adapt its state and actions. Trace, Message, Code Block and the other rightui primitives provide the common structure. These demos use local sample data; connect your own model and tools in your data module.
Demo runtime
Timed examples use an injected clock. Add these members to your root component. Replace the scripted state with events from your TypeScript or Rust data source when connecting a model.
Demo runtime
use defaultFontWeights from "@rightui/ui"
state demoTime = 0
state demoUntil = 0
provide
uiFont = "theme"
uiWeights = defaultFontWeights()
rightuiDemoTime = demoTime
rightuiRunDemo = runDemo
action runDemo(duration: number)
demoUntil = max(demoUntil, demoTime + duration)
action tickDemo
demoTime = min(demoUntil, demoTime + 32)
task demoClock when demoTime < demoUntil
every(32, tickDemo)
Chain of Thought
An expandable summary of observable agent steps.
Chat
A local conversation with an editable prompt and response actions.
Checkpoint
Restore a saved point in a local conversation.
Confirmation
Review a proposed action and explicitly approve or deny it.
Context
Inspect a conversation token budget.
File Tree
Explore collapsible folders and inspect a selected file.
Inline Citation
An inline source reference with a hover and focus card.
Message
One turn, with a user bubble, Markdown reply and response actions.
Model Selector
Choose a sample model and a reasoning effort independently.
Plan
Track a predefined plan and its completion count.
Prompt Input
Compose a message with attachments and a send button.
Queue
Separate remaining work from completed items.
Reasoning
Stream a reasoning summary, expand its details and replay the response.
Sources
Expand the source list and follow the original documentation links.
Stack Trace
Inspect an error and expand its stack frames.
Subagent
Inspect a delegated task, its sample tool calls and result.
Suggestion
Choose a prompt suggestion and inspect the selected local prompt.
Task
Follow steps discovered as work progresses.
Terminal
Reveal sample command output one chunk at a time.
Test Results
Inspect suites, test statuses and failure details.
Tool
Inspect a tool call with structured input and output.