Vercel AI SDK — AI Elements
Overview
AI Elements is Vercel's component library and custom registry built on top of shadcn/ui to help you build AI-native applications faster. It ships composable, focused pieces (Conversation, Message, Prompt Input, Reasoning, Sources, Tool, Attachments, and more) with deep AI SDK integration — streaming, status states, and type safety built in. Because it follows shadcn/ui conventions, your existing theme applies automatically. Read this when building chat, agent, or generative UIs on the AI SDK.
Official sources
Install / setup
npx ai-elements@latest
Add individual components:
npx ai-elements@latest add message
pnpm/bun equivalents are documented (pnpm dlx ai-elements@latest, bunx --bun ai-elements@latest); the AI Elements CLI auto-initializes shadcn/ui if it is not already present.
Core concepts
- Built on shadcn/ui as a custom registry — components are added into your codebase (copy/own model), not hidden behind a dependency.
- Deep AI SDK integration: streaming, status states, and type safety are built into the components.
- Fully composable: small, focused primitives combine into custom chat/agent UIs rather than one monolithic widget.
- Component families span Chatbot (Conversation, Message, Prompt Input, Reasoning, Sources, Tool, Attachments), Code, Voice, and Workflow.
- CSS Variables mode only — relies on shadcn/ui's CSS-variable theming, so your tokens style the components.
Best practices
- Initialize shadcn/ui and configure Tailwind CSS Variables mode before adding Elements (the CLI can set up shadcn/ui automatically).
- Run the CLI with your project's package runner (npx/pnpm dlx/bunx) so dependencies match your package manager.
- Compose primitives (Message + Reasoning + Sources + Tool) instead of building bespoke chat markup, so streaming and status handling come for free.
- Theme through shadcn/ui CSS variables so Elements inherit your brand automatically.
Common pitfalls
- Expecting it to work without shadcn/ui or Tailwind → AI Elements requires shadcn/ui initialized and Tailwind configured (CSS Variables mode).
- Treating it as an npm UI dependency → components are added into your repo via the registry; you own and customize the code.
- Skipping the AI SDK wiring → Elements expect AI SDK message/streaming shapes; pair them with the SDK's hooks.
Examples
# Add a chat conversation surface and prompt input
npx ai-elements@latest add conversation
npx ai-elements@latest add prompt-input
Further reading
Related skills
- ../ai-attachments-ui — attachment UI patterns in AI Elements
- ../ai-tool-ui-patterns — rendering tool-call results
- ../shadcn-tailwind-theming — theming the underlying shadcn/ui layer
1---2name: vercel-ai-sdk-elements3description: AI Elements — composable shadcn/ui components for AI-native apps (chat, reasoning, tools); consult when building AI SDK chat/agent UIs.4domain: reference5category: reference6tags: [ai-sdk, ai-elements, vercel, shadcn, react, ai-ui]7official_sources:8 - https://elements.ai-sdk.dev/9 - https://github.com/vercel/ai-elements10verified: 2026-06-1611metadata:12 source: https://skillmd.com/skills/gabriel7silva/vercel-ai-sdk-elements13---1415# Vercel AI SDK — AI Elements1617## Overview18AI Elements is Vercel's component library and custom registry built on top of shadcn/ui to help you build AI-native applications faster. It ships composable, focused pieces (Conversation, Message, Prompt Input, Reasoning, Sources, Tool, Attachments, and more) with deep AI SDK integration — streaming, status states, and type safety built in. Because it follows shadcn/ui conventions, your existing theme applies automatically. Read this when building chat, agent, or generative UIs on the AI SDK.1920## Official sources21- Docs: https://elements.ai-sdk.dev/22- Repo: https://github.com/vercel/ai-elements23- Setup: https://elements.ai-sdk.dev/docs/setup24- AI SDK: https://ai-sdk.dev/2526## Install / setup27```bash28npx ai-elements@latest29```30Add individual components:31```bash32npx ai-elements@latest add message33```34pnpm/bun equivalents are documented (`pnpm dlx ai-elements@latest`, `bunx --bun ai-elements@latest`); the AI Elements CLI auto-initializes shadcn/ui if it is not already present.3536## Core concepts37- Built on shadcn/ui as a custom registry — components are added into your codebase (copy/own model), not hidden behind a dependency.38- Deep AI SDK integration: streaming, status states, and type safety are built into the components.39- Fully composable: small, focused primitives combine into custom chat/agent UIs rather than one monolithic widget.40- Component families span Chatbot (Conversation, Message, Prompt Input, Reasoning, Sources, Tool, Attachments), Code, Voice, and Workflow.41- CSS Variables mode only — relies on shadcn/ui's CSS-variable theming, so your tokens style the components.4243## Best practices44- Initialize shadcn/ui and configure Tailwind CSS Variables mode before adding Elements (the CLI can set up shadcn/ui automatically).45- Run the CLI with your project's package runner (npx/pnpm dlx/bunx) so dependencies match your package manager.46- Compose primitives (Message + Reasoning + Sources + Tool) instead of building bespoke chat markup, so streaming and status handling come for free.47- Theme through shadcn/ui CSS variables so Elements inherit your brand automatically.4849## Common pitfalls50- Expecting it to work without shadcn/ui or Tailwind → AI Elements requires shadcn/ui initialized and Tailwind configured (CSS Variables mode).51- Treating it as an npm UI dependency → components are added into your repo via the registry; you own and customize the code.52- Skipping the AI SDK wiring → Elements expect AI SDK message/streaming shapes; pair them with the SDK's hooks.5354## Examples55```bash56# Add a chat conversation surface and prompt input57npx ai-elements@latest add conversation58npx ai-elements@latest add prompt-input59```6061## Further reading62- Components index: https://elements.ai-sdk.dev/63- AI SDK UI docs: https://ai-sdk.dev/6465## Related skills66- ../ai-attachments-ui — attachment UI patterns in AI Elements67- ../ai-tool-ui-patterns — rendering tool-call results68- ../shadcn-tailwind-theming — theming the underlying shadcn/ui layer