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)