Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Introducing AI Elements: Prebuilt, composable AI SDK components - Vercel

Vercel News·Hayden Bleasel·4 days ago
#SiEvMpqR
Reading 0:00
15s threshold

AI Elements is a new open source library of customizable React components for building interfaces with the Vercel AI SDK. Built on shadcn/ui , it provides full control over UI primitives like message threads, input boxes, reasoning panels, and response actions. For example, you can use useChat from the AI SDK to manage state and streaming, and render responses using AI Elements. import { Message , MessageContent } from "@/components/ai-elements/message" ; import { Response } from "@/components/ai-elements/response" ; import { useChat } from "@ai-sdk/react" ; export default function Example ( ) { const { messages } = useChat ( ) ; return messages . map ( ( message ) => ( < Message from = { message . role } key = { message . id } > < MessageContent > { message . parts . filter ( ( part ) => part . type === "text" ) . map ( ( part , i ) => ( < Response key = { ` ${ message . id } - ${ i } ` } > { part .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More