
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
ai-elements
Advanced tools
AI Elements is a component library and custom registry built on top of shadcn/ui to help you build AI-native applications faster.
A command-line interface for installing AI Elements components - a component library built on top of shadcn/ui to help you build AI-native applications faster.
AI 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.
You can use the AI Elements CLI directly with npx, or install it globally:
# Use directly (recommended)
npx ai-elements@latest
# Or using shadcn cli
npx shadcn@latest add https://registry.ai-sdk.dev/registry.json
Before using AI Elements, ensure your project meets these requirements:
npx shadcn@latest init
)Install all available AI Elements components at once:
npx ai-elements@latest
This command will:
Install individual components using the add
command:
npx ai-elements@latest add <component-name>
Examples:
# Install the message component
npx ai-elements@latest add message
# Install the conversation component
npx ai-elements@latest add conversation
# Install the code-block component
npx ai-elements@latest add code-block
You can also install components using the standard shadcn/ui CLI:
# Install all components
npx shadcn@latest add https://registry.ai-sdk.dev/registry.json
# Install a specific component
npx shadcn@latest add https://registry.ai-sdk.dev/message.json
AI Elements includes the following components:
Component | Description |
---|---|
actions | Interactive action buttons for AI responses |
branch | Branch visualization for conversation flows |
code-block | Syntax-highlighted code display with copy functionality |
conversation | Container for chat conversations |
image | AI-generated image display component |
inline-citation | Inline source citations |
loader | Loading states for AI operations |
message | Individual chat messages with avatars |
prompt-form | Controlled form wrapper for prompt submission |
prompt-input | Advanced input component with model selection |
prompt-input-attachments | Opt-in file/image attachments for prompt input |
reasoning | Display AI reasoning and thought processes |
response | Formatted AI response display |
source | Source attribution component |
suggestion | Quick action suggestions |
task | Task completion tracking |
tool | Tool usage visualization |
web-preview | Embedded web page previews |
After installing components, you can use them in your React application:
'use client';
import { useChat } from '@ai-sdk/react';
import {
Conversation,
ConversationContent,
} from '@/components/ai-elements/conversation';
import {
Message,
MessageContent,
} from '@/components/ai-elements/message';
import { Response } from '@/components/ai-elements/response';
export default function Chat() {
const { messages } = useChat();
return (
<Conversation>
<ConversationContent>
{messages.map((message, index) => (
<Message key={index} from={message.role}>
<MessageContent>
<Response>{message.content}</Response>
</MessageContent>
</Message>
))}
</ConversationContent>
</Conversation>
);
}
The AI Elements CLI:
https://registry.ai-sdk.dev/registry.json
Components are installed to your configured shadcn/ui components directory (typically @/components/ai-elements/
) and become part of your codebase, allowing for full customization.
AI Elements uses your existing shadcn/ui configuration. Components will be installed to the directory specified in your components.json
file.
For the best experience, we recommend:
AI_GATEWAY_API_KEY
to your .env.local
Made with ❤️ by Vercel
FAQs
AI Elements is a component library and custom registry built on top of shadcn/ui to help you build AI-native applications faster.
The npm package ai-elements receives a total of 4,312 weekly downloads. As such, ai-elements popularity was classified as popular.
We found that ai-elements demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.