# AI Elements (shadcn/ui)

> shadcn/ui patterns for agent interfaces: chat, messages, reasoning, tool calls, plans, citations.

Source: https://tastebase.ehsanulsiam.workers.dev/browse/ai-elements

free

shadcn/ui patterns for agent interfaces: chat, messages, reasoning, tool calls, plans, citations.

by shadcn (Vercel)[GitHub](https://github.com/shadcn-ui/ui)

[visit](https://ui.shadcn.com/docs/ai-elements?utm_source=tastebase&utm_medium=referral&utm_content=detail-page)

[https://ui.shadcn.com/docs/ai-elements](https://ui.shadcn.com/docs/ai-elements?utm_source=tastebase&utm_medium=referral&utm_content=detail-preview)

## Try these

no preview

### [assistant-ui](https://tastebase.ehsanulsiam.workers.dev/browse/assistant-ui)

React primitives and runtime for production AI chat: streaming, threads, tool UI, attachments.

no preview

### [prompt-kit](https://tastebase.ehsanulsiam.workers.dev/browse/prompt-kit)

Small shadcn registry of AI chat parts: prompt input, markdown, code block, reasoning, loaders.

no preview

### [Kobra](https://tastebase.ehsanulsiam.workers.dev/browse/kobra)

A polished shadcn registry on Base UI: quiet gray UI, tuned motion, AI and agent components.

no preview

### [shadcn/ui](https://tastebase.ehsanulsiam.workers.dev/browse/shadcn-ui)

Copy-in React components on Tailwind, built on Base UI, Radix or React Aria, plus a registry CLI.

## For your agent

##### Install

`npx shadcn@latest add message message-scroller bubble`

##### Use it for

- a chat UI on the Vercel AI SDK (`useChat`) inside a shadcn/ui app
- showing what an agent did in a turn: reasoning, tool calls, plan, chain of thought, confirmation before a tool runs
- streaming transcripts that keep scroll position while the reply grows (Message Scroller)

##### Skip it when

- you need threads, branching, retries and backend adapters handled: use assistant-ui
- the project is not on shadcn/ui: use assistant-ui's unstyled primitives and style them with your own kit
- starting from elements.ai-sdk.dev or `npx ai-elements`: that version is deprecated end of November 2026, use the shadcn/ui patterns

##### What's inside21 free

- Chain of Thought
- Chat
- Checkpoint
- Confirmation
- Context
- File Tree
- Inline Citation
- Message
- Model Selector
- Plan
- Prompt Input
- Queue
- Reasoning
- Sources
- Stack Trace
- Subagent
- Suggestion
- Task
- Terminal
- Test Results
- Tool

##### Facts

**Frameworks**
react

**Styling**
copy-in

**Weight**
small

**Accessibility**
ok

**Maturity**
stable

**License**
MIT

**Price**
Free

##### Pairs with

[shadcn/ui](https://tastebase.ehsanulsiam.workers.dev/browse/shadcn-ui)[Motion](https://tastebase.ehsanulsiam.workers.dev/browse/motion)

##### Alternatives

[assistant-ui](https://tastebase.ehsanulsiam.workers.dev/browse/assistant-ui)[prompt-kit](https://tastebase.ehsanulsiam.workers.dev/browse/prompt-kit)[Kobra](https://tastebase.ehsanulsiam.workers.dev/browse/kobra)

[Compare AI Elements (shadcn/ui) with its alternatives](https://tastebase.ehsanulsiam.workers.dev/alternatives/ai-elements-alternatives)

```
import { Bubble, BubbleContent } from "@/components/ui/bubble"
import { Message, MessageContent } from "@/components/ui/message"
import { MessageScroller, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport } from "@/components/ui/message-scroller"

<MessageScrollerProvider>
  <MessageScroller>
    <MessageScrollerViewport>
      <MessageScrollerContent>
        {messages.map((m) => (
          <MessageScrollerItem key={m.id} messageId={m.id} scrollAnchor={m.role === "user"}>
            <Message>
              <MessageContent><Bubble><BubbleContent>{text(m)}</BubbleContent></Bubble></MessageContent>
            </Message>
          </MessageScrollerItem>
        ))}
      </MessageScrollerContent>
    </MessageScrollerViewport>
  </MessageScroller>
</MessageScrollerProvider>
```

https://ui.shadcn.com/docs/ai-elements

Loading website

[Visit](https://ui.shadcn.com/docs/ai-elements?utm_source=tastebase&utm_medium=referral&utm_content=floating-pill)
