Embossed UI

Search documentation

Search for a page or component.

AI Elements

Patterns for agentic interfaces, built from the components in this registry.

AI Elements are patterns for building agentic interfaces. Each one is a composition of components that you copy into your project. There is no package to install. The code is yours.

These are shadcn/ui's AI Elements, line for line. Built from this registry's components, they pick up the design without any change: tool output sits in the recessed Code Block, prompt inputs send with the raised Button, and every step hangs off the engraved Trace line.

A Chat is a list of Message turns inside a Message Scroller. The steps an agent takes inside a turn, like Reasoning, Tool and Plan, are built on Trace, so every step has the same shape.

Building a chatbot? Start from shadcn's chatbot template, then add this registry's components over its components/ui. It is a Next.js app built with the AI SDK, with streaming chat, tool calls, web search and clarifying questions.

Coming from elements.ai-sdk.dev? See Migrating from AI SDK Elements.

Patterns

Migrating from AI SDK Elements

If you used AI SDK Elements from elements.ai-sdk.dev, here is what changes.

Existing projects

You do not need to migrate. When you installed components from elements.ai-sdk.dev, the code was copied into your project. It is yours, and it keeps working as is.

To move a wrapper onto these components, use the prompt in the Migrating from AI SDK Elements section of its pattern page. Paste it into your coding agent. It rebuilds the file in components/ai-elements on Trace, Code Block and the other components, and keeps every export and its props, so the code that uses it does not change.

For example, the Queue prompt rebuilds queue.tsx on Trace, and the Inline Citation prompt rebuilds inline-citation.tsx on Hover Card.

What replaces each element

Each file from AI SDK Elements, and the pattern or component that replaces it.

AI SDK ElementsReplacement
agent.tsxSubagent
attachments.tsxAttachment
chain-of-thought.tsxChain of Thought
checkpoint.tsxCheckpoint
code-block.tsxCode Block
commit.tsxTrace
confirmation.tsxConfirmation
context.tsxContext
conversation.tsxChat
file-tree.tsxFile Tree
inline-citation.tsxInline Citation
message.tsxMessage
model-selector.tsxModel Selector
plan.tsxPlan
prompt-input.tsxPrompt Input
question.tsxQuestionnaire
queue.tsxQueue
reasoning.tsxReasoning
shimmer.tsxshimmer
sources.tsxSources
stack-trace.tsxStack Trace
suggestion.tsxSuggestion
task.tsxTask
terminal.tsxTerminal
test-results.tsxTest Results
tool.tsxTool

Elements without a replacement

We did not rebuild these elements. We looked at how often each one is used, and the numbers are low. Each one is also a small composition you can build from components this registry already has, listed below.

Your copy keeps working. If you still need one of these, open an issue and we will help you build it.

AI SDK ElementsBuild it with
artifact.tsxCard, Button and Tooltip
audio-player.tsxAn audio element, with Button Group and Slider
canvas.tsx, connection.tsx, controls.tsx, edge.tsx, node.tsx, panel.tsx and toolbar.tsxReact Flow, with Card and Button Group
environment-variables.tsxItem, Badge and Switch
image.tsxAn img element
jsx-preview.tsxA JSX parser, like react-jsx-parser
mic-selector.tsx and voice-selector.tsxCombobox
open-in-chat.tsxDropdown Menu
package-info.tsxItem and Badge
persona.tsxA Rive animation
sandbox.tsxTrace, Tabs and Code Block
schema-display.tsxCollapsible, Badge and Code Block
snippet.tsxInput Group
speech-input.tsxButton and Spinner, with the Web Speech API
transcription.tsxA Button for each segment, to seek to it
web-preview.tsxAn iframe, with Input Group for the address bar

New projects

Build from the components instead. For a chatbot, start from the chatbot template.

Add the components

pnpm dlx shadcn@latest add https://ui.ikramhasan.com/r/trace.json https://ui.ikramhasan.com/r/code-block.json

Copy a pattern

Open a pattern above and copy its code into your project. Each page lists any other components it needs.

Or ask your coding agent to do it:

Prompt
Add the Reasoning pattern from https://ui.ikramhasan.com/docs/ai-elements/reasoning to my chat.