AI Elements is a specialized component library (30 components) for building AI-driven user interfaces. These components provide rich conversational, reasoning, and tooling experiences for chat applications, agent dashboards, and workflow visualizations.
message.tsx: Core message bubble with role, content, and metadataconversation.tsx: Full conversation thread container with scrollingattachments.tsx: File/image attachments in messagesinline-citation.tsx: Citation/reference inline within content
code-block.tsx: Syntax-highlighted code displayterminal.tsx: Terminal/shell output componentschema-display.tsx: JSON/TypeScript schema visualizationstack-trace.tsx: Error stack trace displayenvironment-variables.tsx: Env var configuration UI
reasoning.tsx: LLM reasoning/thought process displaychain-of-thought.tsx: Step-by-step reasoning visualizationcheckpoint.tsx: Execution checkpoint indicatortest-results.tsx: Test output display
prompt-input.tsx: Chat input with streaming supporttoolbar.tsx: Action toolbar componentcontrols.tsx: Playback/control buttonsmodel-selector.tsx: Model selection dropdown
canvas.tsx: Infinite canvas for workflow visualizationnode.tsx: Canvas node elementedge.tsx: Canvas connection edgepanel.tsx: Side panel/drawer component
audio-player.tsx: Audio playback componentspeech-input.tsx: Voice/speech inputtranscription.tsx: Speech-to-text displayimage.tsx: Image display with optimization
agent.tsx: Agent status/avatar displaytool.tsx: Tool invocation displayartifact.tsx: Generated artifact previewsandbox.tsx: Code execution sandbox
custom/: Custom extended componentstools/: Tool-specific UI components (has existing AGENTS.md)
src/components/ai-elements/: Main component implementationssrc/components/ai-elements/custom/: Extended variant componentssrc/components/ai-elements/tools/: Tool-specific componentsapp/chat/: Real-world usage in chat interface
Import components directly from the ai-elements package:
import { Message, Reasoning, CodeBlock } from '@/components/ai-elements'
;<Message role="assistant">
<Reasoning steps={['Analyzing...', 'Processing...']} />
<CodeBlock code={result} language="typescript" />
</Message>