翻篇收录说明
翻篇网页快照

AI Elements - shadcn/ui

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

最近抓取:2026-12-03 01:03:27(北京时间)

最近内容变化:2026-11-29 18:30:46(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

Patterns for agentic interfaces, built from shadcn/ui components.

正文摘录

SectionsIntroductionComponentsAI ElementsInstallationThemingCLITypesetSkillsRegistryChangelogComponentsAccordionAlertAlert DialogAspect RatioAttachmentAvatarBadgeBreadcrumbBubbleButtonButton GroupCalendarCardCarouselChartCheckboxCode BlockCollapsibleComboboxCommandContext MenuData TableDate PickerDialogDirectionDrawerDropdown MenuEmptyFieldHover CardInputInput GroupInput OTPItemKbdLabelMarkerMenubarMessageMessage ScrollerNative SelectNavigation MenuPaginationPopoverProgressQuestionnaireRadio GroupResizableScroll AreaSelectSeparatorSheetSidebarSkeletonSliderSpinnerSwitchTableTabsTextareaToastToggleToggle GroupTooltipTraceTypographyAI ElementsIntroductionChain of ThoughtChatCheckpointConfirmationContextFile TreeInline CitationMessageModel SelectorPlanPrompt InputQueueReasoningSourcesStack TraceSubagentSuggestionTaskTerminalTest ResultsToolGet StartedInstallationcomponents.jsonPackage ImportsThemingTypesetDark ModeCLIMonorepoSkillsJavaScriptFigmallms.txtLegacy Docs@shadcn/reactMessage ScrollerQuestionnaire@shadcn/helpersAI SDKTanStack AIFormsReact Hook FormTanStack FormFormischUtilitiesscroll-fadeshimmerRegistryIntroductionGetting StartedGitHub RegistriesRegistry DirectoryRegistry HealthExamplesNamespacesAuthenticationDynamic SearchMCP ServerOpen in v0FAQAPI Referenceregistry.jsonregistry-item.jsonAI ElementsCopy PagePreviousNextPatterns for agentic interfaces, built from shadcn/ui components.AI Elements are patterns for building agentic interfaces. Each one is a composition of shadcn/ui components that you copy into your project. There is no package to install. The code is yours. A Chat is a list of Message turns inside a Message Scroller. The steps an agent takes inside a turn, like Reasoning, Tool and Plan, are built on Trace, so every step has the same shape. Building a chatbot? Start from the chatbot template. It is a Next.js app built with the AI SDK and shadcn/ui, with streaming chat, tool calls, web search and clarifying questions. Coming from elements.ai-sdk.dev? See Migrating from AI SDK Elements. Patterns Chain of ThoughtA summary that expands into the steps an agent took.ChatThe thread. Message Scroller keeps your place while the reply streams.CheckpointA point in the conversation you can return to.ConfirmationA prompt to approve or deny a tool before it runs.ContextHow much of the context window the conversation has used.File TreeThe files the agent changed, as a folder tree.Inline CitationA source in the sentence that opens on hover.MessageOne turn. The person's message, and the agent's reply with its actions.Model SelectorTwo menus. One picks the model the agent runs, the other picks how hard it thinks.PlanThe steps the agent plans to take, and how far it has got.Prompt InputA message field with attachments and a send button.QueueThe agent's todo list, split into what is left and what is done.ReasoningThe agent's thinking as it streams.SourcesThe links the agent used for a reply.Stack TraceA failed tool call and its stack frames.SubagentA subagent run, with its tool calls and result.SuggestionA short prompt you can send to the agent in one click.TaskThe steps the agent takes, as it takes them.TerminalA command the agent runs, with its output as it streams.Test ResultsA test run by the agent, with its suites and failures.ToolA tool call the agent makes, from input to output. Migrating from AI SDK Elements If you used AI SDK Elements from elements.ai-sdk.dev, here is what changes. Existing projects You do not need to migrate. When you installed components from elements.ai-sdk.dev, the code was copied into your project. It is yours, and it keeps working as is. To move a wrapper onto shadcn/ui components, use the prompt in the Migrating from AI SDK Elements section of its pattern page. Paste it into your coding agent. It rebuilds the file in components/ai-elements on Trace, Code Block and the other shadcn/ui components, and keeps every export and its props, so the code that uses it does not change. For example, the Queue prompt rebuilds queue.tsx on Trace, and the Inline Citation prompt rebuilds inline-citation.tsx on Hover Card. What replaces each element Each file from AI SDK Elements, and the shadcn/ui pattern or component that replaces it. AI SDK Elementsshadcn/uiagent.tsxSubagentattachments.tsxAttachmentchain-of-thought.tsxChain of Thoughtcheckpoint.tsxCheckpointcode-block.tsxCode Blockcommit.tsxTraceconfirmation.tsxConfirmationcontext.tsxContextconversation.tsxChatfile-tree.tsxFile Treeinline-citation.tsxInline Citationmessage.tsxMessagemodel-selector.tsxModel Selectorplan.tsxPlanprompt-input.tsxPrompt Inputquestion.tsxQuestionnairequeue.tsxQueuereasoning.tsxReasoningshimmer.tsxshimmersources.tsxSourcesstack-trace.tsxStack Tracesuggestion.tsxSuggestiontask.tsxTaskterminal.tsxTerminaltest-results.tsxTest Resultstool.tsxTool Elements without a replacement We did not rebuild these elements. We looked at how often each one is used, and the numbers are low. Each one is also a small composition you can build from components shadcn/ui already has, listed below. Your copy keeps working. If you still need one of these, open an issue and we will help you build it. AI SDK ElementsBuild it withartifact.tsxCard, Button and Tooltipaudio-player.tsxAn audio element, with Button Group and Slidercanvas.tsx, connection.tsx, controls.tsx, edge.tsx, node.tsx, panel.tsx and toolbar.tsxReact Flow, with Card and Button Groupenvironment-variables.tsxItem, Badge and Switchimage.tsxAn img elementjsx-preview.tsxA JSX parser, like react-jsx-parsermic-selector.tsx and voice-selector.tsxComboboxopen-in-chat.tsxDropdown Menupackage-info.tsxItem and Badgepersona.tsxA Rive animationsandbox.tsxTrace, Tabs and Code Blockschema-display.tsxCollapsible, Badge and Code Blocksnippet.tsxInput Groupspeech-input.tsxButton and Spinner, with the Web Speech APItranscription.tsxA Button for each segment, to seek to itweb-preview.tsxAn iframe, with Input Group for the address bar New projects Build from shadcn/ui components instead. For a chatbot, start from the chatbot template. Add the componentspnpmnpmyarnbunpnpm dlx shadcn@latest add trace code-blockCopyCopy a patternOpen a pattern above and copy its code into your project. Each page lists any other components it needs.Or ask your coding agent to do it:PromptCopyAdd the Reasoning pattern from https://ui.shadcn.com/docs/ai-elements/base/reasoning.md to my chat. Missing an element? Open an issue and tell us what you need. TypographyChain of Thought On This PagePatternsMigrating from AI SDK ElementsExisting projectsWhat replaces each elementElements without a replacementNew projectsDeploy your shadcn/ui app on VercelTrusted by OpenAI, Sonos, Adobe, and more.Vercel provides tools and infrastructure to deploy apps and features at scale.Deploy NowDeploy to Vercel