{"id":30377041,"url":"https://github.com/vercel/ai-elements","last_synced_at":"2026-01-21T07:21:35.407Z","repository":{"id":310587020,"uuid":"1038771433","full_name":"vercel/ai-elements","owner":"vercel","description":"AI Elements is a component library and custom registry built on top of shadcn/ui to help you build AI-native applications faster.","archived":false,"fork":false,"pushed_at":"2025-08-19T03:22:07.000Z","size":623,"stargazers_count":56,"open_issues_count":11,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-19T03:32:31.923Z","etag":null,"topics":["ai","elements","shadcn-ui","vercel"],"latest_commit_sha":null,"homepage":"https://ai-sdk.dev/elements/overview","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vercel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-15T19:37:48.000Z","updated_at":"2025-08-19T02:55:09.000Z","dependencies_parsed_at":"2025-08-19T03:32:48.254Z","dependency_job_id":"7d7d1b2c-d684-44fc-b133-778b18e87b0b","html_url":"https://github.com/vercel/ai-elements","commit_stats":null,"previous_names":["vercel/ai-elements"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/vercel/ai-elements","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fai-elements","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fai-elements/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fai-elements/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fai-elements/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vercel","download_url":"https://codeload.github.com/vercel/ai-elements/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel%2Fai-elements/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271345718,"owners_count":24743496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","elements","shadcn-ui","vercel"],"created_at":"2025-08-20T16:01:25.584Z","updated_at":"2026-01-21T07:21:35.397Z","avatar_url":"https://github.com/vercel.png","language":"TypeScript","readme":"# ▲ AI Elements\n\n[AI Elements](https://ai-sdk.dev/elements) is a component library built on top of [shadcn/ui](https://ui.shadcn.com/) to help you build AI-native applications faster.\n\n## Overview\n\nAI Elements provides pre-built, customizable React components specifically designed for AI applications, including conversations, messages, code blocks, reasoning displays, and more. The CLI makes it easy to add these components to your Next.js project.\n\n## Installation\n\nYou can use the AI Elements CLI directly with npx, or install it globally:\n\n```bash\n# Use directly (recommended)\nnpx ai-elements@latest\n\n# Or using shadcn cli\nnpx shadcn@latest add https://ai-sdk.dev/elements/api/registry/all.json\n```\n\n## Prerequisites\n\nBefore using AI Elements, ensure your project meets these requirements:\n\n- **Node.js** 18 or later\n- **Next.js** project with [AI SDK](https://ai-sdk.dev/) installed\n- **shadcn/ui** initialized in your project (`npx shadcn@latest init`)\n- **Tailwind CSS** configured (AI Elements supports CSS Variables mode only)\n\n## Usage\n\n### Install All Components\n\nInstall all available AI Elements components at once:\n\n```bash\nnpx ai-elements@latest\n```\n\nThis command will:\n\n- Set up shadcn/ui if not already configured\n- Install all AI Elements components to your configured components directory\n- Add necessary dependencies to your project\n\n### Install Specific Components\n\nInstall individual components using the `add` command:\n\n```bash\nnpx ai-elements@latest add \u003ccomponent-name\u003e\n```\n\nExamples:\n\n```bash\n# Install the message component\nnpx ai-elements@latest add message\n\n# Install the conversation component\nnpx ai-elements@latest add conversation\n\n# Install the code-block component\nnpx ai-elements@latest add code-block\n```\n\n### Alternative: Use with shadcn CLI\n\nYou can also install components using the standard shadcn/ui CLI:\n\n```bash\n# Install all components\nnpx shadcn@latest add https://ai-sdk.dev/elements/api/registry/all.json\n\n# Install a specific component\nnpx shadcn@latest add https://ai-sdk.dev/elements/api/registry/message.json\n```\n\n## Available Components\n\nAI Elements includes the following components:\n\n| Component          | Description                                             |\n| ------------------ | ------------------------------------------------------- |\n| **Chatbot**        |                                                         |\n| `actions`          | Interactive action buttons for AI responses             |\n| `branch`           | Branch visualization for conversation flows             |\n| `chain-of-thought` | Display AI reasoning and thought processes              |\n| `code-block`       | Syntax-highlighted code display with copy functionality |\n| `context`          | Display Context consumption                             |\n| `conversation`     | Container for chat conversations                        |\n| `image`            | AI-generated image display component                    |\n| `inline-citation`  | Inline source citations                                 |\n| `loader`           | Loading states for AI operations                        |\n| `message`          | Individual chat messages with avatars                   |\n| `open-in-chat`     | Open in chat button for a message                       |\n| `plan`             | Plan and task planning display component                |\n| `prompt-input`     | Advanced input component with model selection           |\n| `queue`            | Message and todo queue with attachments                 |\n| `reasoning`        | Display AI reasoning and thought processes              |\n| `response`         | Formatted AI response display                           |\n| `shimmer`          | Text shimmer animation effect                           |\n| `sources`          | Source attribution component                            |\n| `suggestion`       | Quick action suggestions                                |\n| `task`             | Task completion tracking                                |\n| `tool`             | Tool usage visualization                                |\n| `confirmation`     | Tool execution approval workflows                       |\n| **Vibe-Coding**    |                                                         |\n| `artifact`         | Display a code or document                              |\n| `web-preview`      | Embedded web page previews                              |\n| **Workflow**       |                                                         |\n| `canvas`           | ReactFlow canvas for workflow visualizations            |\n| `connection`       | Connection line component for workflow edges            |\n| `controls`         | Flow controls for canvas (zoom, fit view, etc.)         |\n| `edge`             | Edge component for connections between workflow nodes   |\n| `node`             | Node component for workflow graphs                      |\n| `panel`            | Panel component for canvas overlays                     |\n| `toolbar`          | Node toolbar for workflow elements                      |\n\n## Quick Start Example\n\nAfter installing components, you can use them in your React application:\n\n```tsx\n'use client';\n\nimport { useChat } from '@ai-sdk/react';\nimport {\n  Conversation,\n  ConversationContent,\n} from '@/components/ai-elements/conversation';\nimport {\n  Message,\n  MessageContent,\n  MessageResponse,\n} from '@/components/ai-elements/message';\n\nexport default function Chat() {\n  const { messages } = useChat();\n\n  return (\n    \u003cConversation\u003e\n      \u003cConversationContent\u003e\n        {messages.map((message, index) =\u003e (\n          \u003cMessage key={index} from={message.role}\u003e\n            \u003cMessageContent\u003e\n              \u003cMessageResponse\u003e{message.content}\u003c/MessageResponse\u003e\n            \u003c/MessageContent\u003e\n          \u003c/Message\u003e\n        ))}\n      \u003c/ConversationContent\u003e\n    \u003c/Conversation\u003e\n  );\n}\n```\n\n## How It Works\n\nThe AI Elements CLI:\n\n1. **Detects your package manager** (npm, pnpm, yarn, or bun) automatically\n2. **Fetches component registry** from `https://ai-sdk.dev/elements/api/registry/registry.json`\n3. **Installs components** using the shadcn/ui CLI under the hood\n4. **Adds dependencies** and integrates with your existing shadcn/ui setup\n\nComponents are installed to your configured shadcn/ui components directory (typically `@/components/ai-elements/`) and become part of your codebase, allowing for full customization.\n\n## Configuration\n\nAI Elements uses your existing shadcn/ui configuration. Components will be installed to the directory specified in your `components.json` file.\n\n## Recommended Setup\n\nFor the best experience, we recommend:\n\n1. **AI Gateway**: Set up [Vercel AI Gateway](https://vercel.com/docs/ai-gateway) and add `AI_GATEWAY_API_KEY` to your `.env.local`\n2. **CSS Variables**: Use shadcn/ui's CSS Variables mode for theming\n3. **TypeScript**: Enable TypeScript for better development experience\n\n## Contributing\n\nIf you'd like to contribute to AI Elements, please follow these steps:\n\n1. Fork the repository\n2. Create a new branch\n3. Make your changes to the components in `packages/elements`.\n4. Open a PR to the `main` branch.\n\n---\n\nMade with ❤️ by [Vercel](https://vercel.com)\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvercel%2Fai-elements","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvercel%2Fai-elements","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvercel%2Fai-elements/lists"}