# Jenny DS — Full Particles Source Complete source code for all 539 particles, grouped by category. For metadata only, see /llms.txt. For machine-readable index, see /particles-search-index.json. Browse: https://jennyds.kudvov.ru/ui/particles Install any: `npx shadcn@latest add @jenny/` --- ## accordion (4) ### p-accordion-1 **Basic accordion** ```tsx import { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, } from "@/registry/default/ui/accordion"; export default function Particle() { const items = [ { content: "Base UI is a library of high-quality unstyled React components for design systems and web apps.", id: "1", title: "What is Base UI?", }, { content: "Head to the \"Quick start\" guide in the docs. If you've used unstyled libraries before, you'll feel at home.", id: "2", title: "How do I get started?", }, { content: "Of course! Base UI is free and open source.", id: "3", title: "Can I use it for my project?", }, ]; return ( {items.map((item) => ( {item.title} {item.content} ))} ); } ``` ### p-accordion-2 **Accordion with one panel open** ```tsx import { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, } from "@/registry/default/ui/accordion"; export default function Particle() { return ( What is Base UI? Base UI is a library of high-quality unstyled React components for design systems and web apps. How do I get started? Head to the "Quick start" guide in the docs. If you've used unstyled libraries before, you'll feel at home. Can I use it for my project? Of course! Base UI is free and open source. ); } ``` ### p-accordion-3 **Accordion allowing multiple panels open** ```tsx import { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, } from "@/registry/default/ui/accordion"; export default function Particle() { return ( What is Base UI? Base UI is a library of high-quality unstyled React components for design systems and web apps. How do I get started? Head to the "Quick start" guide in the docs. If you've used unstyled libraries before, you'll feel at home. Can I use it for my project? Of course! Base UI is free and open source. ); } ``` ### p-accordion-4 **Controlled accordion** ```tsx "use client"; import { useState } from "react"; import { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, } from "@/registry/default/ui/accordion"; import { Button } from "@/registry/default/ui/button"; export default function Particle() { const [value, setValue] = useState([]); return (
What is Base UI? Base UI is a library of high-quality unstyled React components for design systems and web apps. How do I get started? Head to the "Quick start" guide in the docs. If you've used unstyled libraries before, you'll feel at home. Can I use it for my project? Of course! Base UI is free and open source.

Open items: {value.length > 0 ? value.join(", ") : "None"}

); } ``` ## ai (53) ### p-chat-1 **Full AI chat: history, suggestions, prompt input** Tags: ai, chat ```tsx "use client"; import { CopyIcon, RotateCcwIcon, ThumbsUpIcon } from "lucide-react"; import { useState } from "react"; import { ChatConversation, ChatConversationContent, ChatConversationScrollButton, } from "@/registry/default/ui/chat-conversation"; import { ChatMessage, ChatMessageAction, ChatMessageActions, ChatMessageAvatar, ChatMessageContent, ChatMessageToolbar, } from "@/registry/default/ui/chat-message"; import { ChatPromptInput, ChatPromptInputSubmit, ChatPromptInputTextarea, ChatPromptInputToolbar, ChatPromptInputTools, } from "@/registry/default/ui/chat-prompt-input"; import { ChatResponse } from "@/registry/default/ui/chat-response"; import { ChatSuggestion, ChatSuggestions, } from "@/registry/default/ui/chat-suggestion"; type ChatRole = "user" | "assistant"; type ChatItem = { id: string; role: ChatRole; content: string }; const seedMessages: ChatItem[] = [ { id: "m1", role: "user", content: "Объясни кратко, что такое Jenny DS", }, { id: "m2", role: "assistant", content: "**Jenny DS** — это библиотека компонентов на [Base UI](https://base-ui.com/) с shadcn-стилем установки (`npx shadcn@latest add`). Особенности:\n\n- 50+ примитивов: `Button`, `Dialog`, `Select`, и т.д.\n- 480+ готовых particles — собранных блоков (формы, карточки, тулбары)\n- Tailwind v4 и семантические токены тем\n- Поддержка dark mode из коробки", }, ]; const suggestions = [ "Какие компоненты есть?", "Покажи пример формы", "Как кастомизировать тему?", "Сравни с shadcn/ui", ]; export default function Particle() { const [messages, setMessages] = useState(seedMessages); const [status, setStatus] = useState<"ready" | "streaming">("ready"); const send = (text: string) => { const userMsg: ChatItem = { id: `u-${Date.now()}`, role: "user", content: text, }; const reply: ChatItem = { id: `a-${Date.now()}`, role: "assistant", content: `Понял, ты спросил: «${text}». В демо я просто эхо, но в боевом сценарии тут был бы стримящийся ответ от модели.`, }; setMessages((prev) => [...prev, userMsg]); setStatus("streaming"); setTimeout(() => { setMessages((prev) => [...prev, reply]); setStatus("ready"); }, 600); }; return (
{messages.map((m) => ( {m.role === "assistant" ? ( ) : null} {m.role === "assistant" ? ( {m.content} ) : ( m.content )} {m.role === "assistant" ? ( ) : null} ))} {suggestions.map((s) => ( ))}
); } ``` ### p-chat-2 **Full AI chat with reasoning, code, image, sources, attachments** Tags: ai, chat ```tsx "use client"; import { CopyIcon } from "lucide-react"; import { useCallback, useState } from "react"; import { ChatAttachment, type ChatAttachmentData, ChatAttachments, } from "@/registry/default/ui/chat-attachments"; import { ChatCodeBlock, ChatCodeBlockActions, ChatCodeBlockCopyButton, ChatCodeBlockFilename, ChatCodeBlockHeader, } from "@/registry/default/ui/chat-code-block"; import { ChatConversation, ChatConversationContent, ChatConversationScrollButton, } from "@/registry/default/ui/chat-conversation"; import { ChatImage } from "@/registry/default/ui/chat-image"; import { ChatMessage, ChatMessageAction, ChatMessageActions, ChatMessageAvatar, ChatMessageContent, ChatMessageToolbar, } from "@/registry/default/ui/chat-message"; import { ChatPromptInput, ChatPromptInputAttachmentTrigger, ChatPromptInputModelSelect, ChatPromptInputSubmit, ChatPromptInputTextarea, ChatPromptInputToolbar, ChatPromptInputTools, } from "@/registry/default/ui/chat-prompt-input"; import { ChatReasoning, ChatReasoningContent, ChatReasoningTrigger, } from "@/registry/default/ui/chat-reasoning"; import { ChatResponse } from "@/registry/default/ui/chat-response"; import { ChatSource, ChatSources, ChatSourcesContent, ChatSourcesTrigger, } from "@/registry/default/ui/chat-sources"; const sources = [ { title: "Cache Components — nextjs.org", href: "https://nextjs.org/docs/app/getting-started/cache-components", }, { title: "use cache — nextjs.org", href: "https://nextjs.org/docs/app/api-reference/directives/use-cache", }, ]; const reasoning = `Сначала вспомню, что Cache Components — это новый primary API, заменяющий \`fetch({ next: { revalidate } })\`. Кратко покажу разницу и приведу пример с \`updateTag\` для инвалидации.`; const code = `// app/products/[id]/page.tsx "use cache"; import { cacheTag, updateTag } from "next/cache"; export default async function ProductPage({ params }) { const { id } = await params; cacheTag(\`product:\${id}\`); const product = await db.product.get(id); return ; }`; const models = [ { value: "opus", label: "Claude Opus 4.7", description: "Большие задачи" }, { value: "sonnet", label: "Claude Sonnet 4.7", description: "Универсал" }, { value: "haiku", label: "Claude Haiku 4.7", description: "Быстро" }, ]; export default function Particle() { const [model, setModel] = useState("opus"); const [attachments, setAttachments] = useState([ { id: "1", name: "screen.png", mediaType: "image/png", url: "https://picsum.photos/seed/jenny-ds/240/180", size: 124_503, }, ]); const onFiles = useCallback((files: FileList) => { const next: ChatAttachmentData[] = Array.from(files).map((f, i) => ({ id: `${Date.now()}-${i}`, name: f.name, mediaType: f.type, size: f.size, url: URL.createObjectURL(f), })); setAttachments((prev) => [...prev, ...next]); }, []); return (
Расскажи про Cache Components в Next.js 16 — чем отличаются от старого revalidate? {reasoning} **Cache Components** кешируют рендер компонента целиком через `"use cache"` директиву, а `updateTag` точечно инвалидирует нужный фрагмент. Пример: page.tsx {sources.map((s) => ( ))} {attachments.length > 0 ? ( {attachments.map((a) => ( setAttachments((items) => items.filter((i) => i.id !== a.id)) } /> ))} ) : null} undefined}>
); } ``` ### p-chat-3 **Agentic workflow: reasoning, plan, tool-call, response and actions** Tags: ai, chat ```tsx "use client"; import { useEffect, useState } from "react"; import { ChatActionCopy, ChatActionFeedback, ChatActionRegenerate, ChatActions, } from "@/registry/default/ui/chat-actions"; import { ChatContext, ChatContextPopup, ChatContextTrigger, } from "@/registry/default/ui/chat-context"; import { ChatConversation, ChatConversationContent, } from "@/registry/default/ui/chat-conversation"; import { ChatLoader } from "@/registry/default/ui/chat-loader"; import { ChatMessage, ChatMessageAvatar, ChatMessageContent, ChatMessageToolbar, } from "@/registry/default/ui/chat-message"; import { ChatPromptInput, ChatPromptInputSubmit, ChatPromptInputTextarea, ChatPromptInputToolbar, ChatPromptInputTools, } from "@/registry/default/ui/chat-prompt-input"; import { ChatReasoning, ChatReasoningContent, ChatReasoningTrigger, } from "@/registry/default/ui/chat-reasoning"; import { ChatResponse } from "@/registry/default/ui/chat-response"; import { ChatTask, ChatTaskContent, ChatTaskFile, ChatTaskItem, ChatTaskTrigger, } from "@/registry/default/ui/chat-task"; import { ChatTool, ChatToolContent, ChatToolHeader, ChatToolInput, ChatToolOutput, } from "@/registry/default/ui/chat-tool"; const reasoning = `Пользователь спросил про разницу между Cache Components и старым revalidate. 1. Сделаю web_search чтобы взять свежую цитату из nextjs.org 2. Прочитаю текущую кодовую базу — \`app/products/[id]/page.tsx\` 3. Сравню оба подхода и приведу мини-пример`; const finalAnswer = `Cache Components (Next 16) кешируют **рендер компонента целиком** через директиву \`"use cache"\`. В отличие от устаревшего \`fetch({ next: { revalidate } })\` инвалидация теперь точечная — через \`updateTag\` / \`updateCache\` в любом server action.`; const searchOutput = { results: [ { title: "Cache Components — Next.js", url: "https://nextjs.org/docs/app/getting-started/cache-components", snippet: "Cache Components let you cache the result of rendering a Server Component and reuse it across requests.", }, ], }; export default function Particle() { const [isStreaming, setIsStreaming] = useState(true); useEffect(() => { const t = setTimeout(() => setIsStreaming(false), 2400); return () => clearTimeout(t); }, []); return (

Agentic chat — Phase 3 demo

Объясни разницу Cache Components и старого revalidate, дополни цитатой из docs. Reasoning…} /> {reasoning} Search the web for current docs Read app/products/[id]/page.tsx Compose answer {isStreaming ? ( Writing answer… ) : ( {finalAnswer} )} {isStreaming ? null : ( )} undefined}>
); } ``` ### p-chat-4 **Coding agent workspace: file tree, terminal, tests, stack** Tags: ai, chat ```tsx "use client"; import { useState } from "react"; import { ChatActionCopy, ChatActionRegenerate, ChatActions, } from "@/registry/default/ui/chat-actions"; import { ChatConversation, ChatConversationContent, } from "@/registry/default/ui/chat-conversation"; import { ChatFileTree, ChatFileTreeFile, ChatFileTreeFolder, } from "@/registry/default/ui/chat-file-tree"; import { ChatMessage, ChatMessageAvatar, ChatMessageContent, ChatMessageToolbar, } from "@/registry/default/ui/chat-message"; import { ChatPromptInput, ChatPromptInputSubmit, ChatPromptInputTextarea, ChatPromptInputToolbar, ChatPromptInputTools, } from "@/registry/default/ui/chat-prompt-input"; import { ChatResponse } from "@/registry/default/ui/chat-response"; import { ChatSnippet } from "@/registry/default/ui/chat-snippet"; import { ChatStackTrace } from "@/registry/default/ui/chat-stack-trace"; import { ChatTask, ChatTaskContent, ChatTaskFile, ChatTaskItem, ChatTaskTrigger, } from "@/registry/default/ui/chat-task"; import { ChatTerminal } from "@/registry/default/ui/chat-terminal"; import { ChatTest, ChatTestError, ChatTestResults, ChatTestResultsHeader, ChatTestResultsProgress, ChatTestResultsSummary, ChatTestSuite, } from "@/registry/default/ui/chat-test-results"; const terminalOutput = [ "\x1b[2m$\x1b[0m bun test auth", "", "\x1b[36m●\x1b[0m auth.test.ts", " \x1b[32m✓\x1b[0m signs in with valid credentials \x1b[2m(42ms)\x1b[0m", " \x1b[31m✗\x1b[0m rate-limits after 5 attempts \x1b[2m(180ms)\x1b[0m", "", "\x1b[31m1 failed\x1b[0m, \x1b[32m5 passed\x1b[0m of 6 tests", ].join("\n"); const stack = `AssertionError: expected 429, got 200 at Object. (auth.test.ts:84:14) at expect (node_modules/vitest/dist/index.js:32:11) at processTicksAndRejections (node:internal/process/task_queues:96:5)`; const reply = `Тест \`auth.test.ts > rate-limits after 5 attempts\` упал — middleware возвращает **200** вместо **429**. Скорее всего \`rateLimit\` не вызывает \`throw\` при превышении квоты. Сейчас покажу патч.`; export default function Particle() { const [selectedFile, setSelectedFile] = useState("app/api/auth/route.ts"); return (
Запусти и расскажи, что не так. Ran bun test auth Inspected{" "} app/api/auth/route.ts and{" "} tests/auth.test.ts Parsed stack trace Draft patch {stack} {reply} undefined}>
); } ``` ### p-chat-5 **Voice chat: mic, voice picker, audio player, transcription** Tags: ai, chat ```tsx "use client"; import { useState } from "react"; import { ChatAudioPlayer } from "@/registry/default/ui/chat-audio-player"; import { ChatConversation, ChatConversationContent, } from "@/registry/default/ui/chat-conversation"; import { ChatMessage, ChatMessageAvatar, ChatMessageContent, } from "@/registry/default/ui/chat-message"; import { type ChatMicDevice, ChatMicSelector, } from "@/registry/default/ui/chat-mic-selector"; import { ChatPromptInput, ChatPromptInputSubmit, ChatPromptInputTextarea, ChatPromptInputToolbar, ChatPromptInputTools, } from "@/registry/default/ui/chat-prompt-input"; import { ChatSpeechInput } from "@/registry/default/ui/chat-speech-input"; import { ChatTranscription, type ChatTranscriptionSegment, } from "@/registry/default/ui/chat-transcription"; import { type ChatVoice, ChatVoiceSelector, } from "@/registry/default/ui/chat-voice-selector"; const micDevices: ChatMicDevice[] = [ { deviceId: "default", label: "Default" }, { deviceId: "macbook", label: "MacBook Pro Microphone" }, ]; const voices: ChatVoice[] = [ { id: "alloy", name: "Alloy", lang: "en-US", provider: "OpenAI" }, { id: "echo", name: "Echo", lang: "en-US", provider: "OpenAI" }, { id: "shimmer", name: "Shimmer", lang: "en-US", provider: "OpenAI" }, ]; const userSegments: ChatTranscriptionSegment[] = [ { text: "Read", startSecond: 0, endSecond: 0.3 }, { text: "me", startSecond: 0.35, endSecond: 0.55 }, { text: "the", startSecond: 0.6, endSecond: 0.75 }, { text: "weather", startSecond: 0.85, endSecond: 1.3 }, { text: "in", startSecond: 1.35, endSecond: 1.5 }, { text: "Moscow.", startSecond: 1.6, endSecond: 2.1 }, ]; const assistantSegments: ChatTranscriptionSegment[] = [ { text: "Currently", startSecond: 0, endSecond: 0.8 }, { text: "in", startSecond: 0.85, endSecond: 1.0 }, { text: "Moscow", startSecond: 1.05, endSecond: 1.5 }, { text: "it's", startSecond: 1.55, endSecond: 1.8 }, { text: "minus", startSecond: 1.85, endSecond: 2.15 }, { text: "four", startSecond: 2.2, endSecond: 2.5 }, { text: "degrees", startSecond: 2.55, endSecond: 3.0 }, { text: "with", startSecond: 3.05, endSecond: 3.25 }, { text: "light", startSecond: 3.3, endSecond: 3.55 }, { text: "snow.", startSecond: 3.6, endSecond: 4.1 }, ]; export default function Particle() { const [mic, setMic] = useState("default"); const [voice, setVoice] = useState("alloy"); const [draft, setDraft] = useState(""); return (

Voice chat

setDraft("")}> setDraft(event.currentTarget.value)} placeholder="Hold mic to talk, or type a message…" value={draft} /> { setDraft(text); if (isFinal) { // In a real app you'd send here; demo just clears setTimeout(() => setDraft(""), 500); } }} />
); } ``` ### p-chat-6 **Agentic platform shell: persona, connections, queue, confirmation** Tags: ai, chat ```tsx "use client"; import { RotateCwIcon } from "lucide-react"; import { useState } from "react"; import { Button } from "@/registry/default/ui/button"; import { ChatAgent, ChatAgentContent, ChatAgentHeader, ChatAgentInstructions, type ChatAgentTool, ChatAgentTools, } from "@/registry/default/ui/chat-agent"; import { ChatCheckpoint, ChatCheckpointIcon, ChatCheckpointLabel, ChatCheckpointTrigger, } from "@/registry/default/ui/chat-checkpoint"; import { ChatConfirmation, ChatConfirmationAction, ChatConfirmationActions, type ChatConfirmationApproval, ChatConfirmationApproved, ChatConfirmationPending, ChatConfirmationRejected, ChatConfirmationTitle, } from "@/registry/default/ui/chat-confirmation"; import { ChatConnection, ChatConnectionActions, ChatConnectionIndicator, ChatConnectionLatency, ChatConnectionName, ChatConnectionStatusLabel, } from "@/registry/default/ui/chat-connection"; import { ChatConversation, ChatConversationContent, } from "@/registry/default/ui/chat-conversation"; import { ChatMessage, ChatMessageAvatar, ChatMessageContent, } from "@/registry/default/ui/chat-message"; import { ChatPersona, ChatPersonaAvatar, ChatPersonaInfo, ChatPersonaName, type ChatPersonaOption, ChatPersonaStateLabel, ChatPersonaSwitcher, } from "@/registry/default/ui/chat-persona"; import { ChatQueue, ChatQueueItem, ChatQueueItemAttachments, ChatQueueItemFile, ChatQueueItemIndicator, ChatQueueItemRow, ChatQueueItemTitle, ChatQueueSection, ChatQueueSectionContent, ChatQueueSectionTrigger, } from "@/registry/default/ui/chat-queue"; const personas: ChatPersonaOption[] = [ { id: "research", name: "Researcher", description: "Cites every claim", fallback: "R", }, { id: "code", name: "Code reviewer", description: "Spots bugs early", fallback: "C", }, ]; const tools: ChatAgentTool[] = [ { name: "fs.read", description: "Read files in the workspace" }, { name: "git.diff", description: "Show pending changes" }, { name: "shell.exec", description: "Run shell commands (requires approval)" }, ]; export default function Particle() { const [active, setActive] = useState("code"); const [approval, setApproval] = useState({}); return (
Code reviewer
You review PRs. Read changed files, point out bugs, and ask the user before executing destructive commands. Очисти все node_modules перед клонированием — нужно свежее окружение. Готов выполнить, но это destructive — подтверди. Allow agent to run rm -rf node_modules? setApproval({ approved: false, reason: "User declined cleanup.", }) } variant="ghost" > Reject setApproval({ approved: true })} > Approve

Approved · running shell.exec…

Rejected — skipping destructive step.

Saved · 14:02 Restore Хорошо, продолжай с чистым клоном.
); } ``` ### p-chat-7 **Rich content split view: conversation, artifact panel, code, live JSX preview** Tags: ai, chat ```tsx "use client"; import { DownloadIcon, ExternalLinkIcon } from "lucide-react"; import { useEffect, useState } from "react"; import { Badge } from "@/registry/default/ui/badge"; import { Button } from "@/registry/default/ui/button"; import { ChatArtifact, ChatArtifactAction, ChatArtifactActions, ChatArtifactClose, ChatArtifactContent, ChatArtifactDescription, ChatArtifactFooter, ChatArtifactHeader, ChatArtifactInfo, ChatArtifactTitle, } from "@/registry/default/ui/chat-artifact"; import { ChatCodeBlock, ChatCodeBlockActions, ChatCodeBlockCopyButton, ChatCodeBlockFilename, ChatCodeBlockHeader, } from "@/registry/default/ui/chat-code-block"; import { ChatCommit, ChatCommitActions, ChatCommitAuthor, ChatCommitAvatar, ChatCommitContent, ChatCommitCopyHashButton, ChatCommitFile, ChatCommitHash, ChatCommitHeader, ChatCommitInfo, ChatCommitMessage, ChatCommitMetadata, ChatCommitSeparator, ChatCommitTimestamp, } from "@/registry/default/ui/chat-commit"; import { ChatConversation, ChatConversationContent, } from "@/registry/default/ui/chat-conversation"; import { ChatJsxPreview } from "@/registry/default/ui/chat-jsx-preview"; import { ChatMessage, ChatMessageAvatar, ChatMessageContent, } from "@/registry/default/ui/chat-message"; import { ChatPackageInfo, ChatPackageInfoDescription, } from "@/registry/default/ui/chat-package-info"; import { ChatResponse } from "@/registry/default/ui/chat-response"; import { ChatSchemaDisplay, ChatSchemaDisplayContent, ChatSchemaDisplayDescription, ChatSchemaDisplayHeader, ChatSchemaDisplayMethod, ChatSchemaDisplayPath, ChatSchemaParameter, ChatSchemaSection, } from "@/registry/default/ui/chat-schema-display"; const code = `// app/products/[id]/page.tsx "use cache"; import { cacheTag } from "next/cache"; export default async function ProductPage({ params }) { const { id } = await params; cacheTag(\`product:\${id}\`); const product = await db.product.get(id); return ; }`; const finalJsx = `

Cache Components

New in 16.1

Cache rendered Server Components with the "use cache" directive.

`; const commitDate = new Date(Date.now() - 36 * 60 * 60 * 1000); export default function Particle() { const [jsx, setJsx] = useState(""); const [streaming, setStreaming] = useState(true); useEffect(() => { let i = 0; const id = setInterval(() => { i = Math.min(i + 22, finalJsx.length); setJsx(finalJsx.slice(0, i)); if (i >= finalJsx.length) { setStreaming(false); clearInterval(id); } }, 70); return () => clearInterval(id); }, []); return (
Покажи как мигрировать с старого revalidate на Cache Components. Вот что меняется в **Next.js 16.1**. Открыл артефакт справа с патчем — посмотри подсветку. Cache Components and Turbopack stable. /api/cache/invalidate Manual cache tag invalidation. Call from server actions. feat: introduce Cache Components primary API a1b2c3d Mikhail Vorobyov
); } ``` ### p-chat-8 **Final agentic workspace: model selector, plan, sandbox, canvas, open-in** Tags: ai, chat ```tsx "use client"; import type { Edge, Node, NodeTypes } from "@xyflow/react"; import { useState } from "react"; import { Badge } from "@/registry/default/ui/badge"; import { Button } from "@/registry/default/ui/button"; import { ChatCanvas } from "@/registry/default/ui/chat-canvas"; import { ChatConversation, ChatConversationContent, } from "@/registry/default/ui/chat-conversation"; import { ChatEdge } from "@/registry/default/ui/chat-edge"; import { ChatMessage, ChatMessageAvatar, ChatMessageContent, } from "@/registry/default/ui/chat-message"; import { type ChatModelOption, ChatModelSelector, } from "@/registry/default/ui/chat-model-selector"; import { ChatNode, ChatNodeContent, ChatNodeHeader, ChatNodeTitle, } from "@/registry/default/ui/chat-node"; import { ChatOpenIn, ChatOpenInChatGPT, ChatOpenInClaude, ChatOpenInCursor, ChatOpenInPopup, ChatOpenInTrigger, } from "@/registry/default/ui/chat-open-in-chat"; import { ChatPanel, ChatPanelContent, ChatPanelHeader, ChatPanelTitle, } from "@/registry/default/ui/chat-panel"; import { ChatPlan, ChatPlanAction, ChatPlanContent, ChatPlanDescription, ChatPlanHeader, ChatPlanStep, ChatPlanTitle, ChatPlanTrigger, } from "@/registry/default/ui/chat-plan"; import { ChatPromptInput, ChatPromptInputSubmit, ChatPromptInputTextarea, ChatPromptInputToolbar, ChatPromptInputTools, } from "@/registry/default/ui/chat-prompt-input"; import { ChatResponse } from "@/registry/default/ui/chat-response"; import { ChatSandbox, ChatSandboxContent, ChatSandboxFrame, ChatSandboxHeader, ChatSandboxTab, ChatSandboxTabPanel, ChatSandboxTabs, ChatSandboxTabsBar, ChatSandboxTabsList, } from "@/registry/default/ui/chat-sandbox"; const models: ChatModelOption[] = [ { id: "opus", name: "Claude Opus 4.7", provider: "Anthropic" }, { id: "sonnet", name: "Claude Sonnet 4.7", provider: "Anthropic" }, { id: "gpt5", name: "GPT-5", provider: "OpenAI" }, ]; const planSteps = [ "Read existing data layer", "Find revalidate call sites", "Rewrite with `cacheTag`", "Update tests", ]; const AgentNode = ({ data }: { data: { name: string; role: string } }) => ( {data.name}

{data.role}

); const nodeTypes: NodeTypes = { agent: AgentNode }; const edgeTypes = { animated: ChatEdge.Animated, temporary: ChatEdge.Temporary, }; const nodes: Node[] = [ { id: "planner", type: "agent", position: { x: 0, y: 0 }, data: { name: "Planner", role: "decomposes" }, }, { id: "coder", type: "agent", position: { x: 320, y: 0 }, data: { name: "Coder", role: "writes patches" }, }, ]; const edges: Edge[] = [ { id: "p-c", source: "planner", target: "coder", type: "animated" }, ]; const lastMessage = "Покажи Cache Components migration на примере dashboard"; export default function Particle() { const [model, setModel] = useState("opus"); return (
{lastMessage}
Migration plan Switch dashboard data fetches to Cache Components.
{planSteps.map((step, i) => ( {step} ))}
Preview Logs
                          [ready] in 248ms · HMR connected
                        
Готово — план открыт сверху, песочница активна. Граф агентов в правой панели показывает текущий поток данных.
undefined}>
); } ``` ### p-chat-actions-1 **Message toolbar: copy, regenerate, edit, like, dislike** Tags: ai, chat, chat actions ```tsx import { ChatActionCopy, ChatActionEdit, ChatActionFeedback, ChatActionRegenerate, ChatActions, } from "@/registry/default/ui/chat-actions"; import { ChatMessage, ChatMessageAvatar, ChatMessageContent, ChatMessageToolbar, } from "@/registry/default/ui/chat-message"; const response = "Jenny DS — это коллекция компонентов на Base UI с CLI-установкой через shadcn. Включает 50+ примитивов и 500+ готовых particles."; export default function Particle() { return (
{response}
); } ``` ### p-chat-agent-1 **Agent identity card with name, model, instructions, tools** Tags: ai, chat ```tsx import { ChatAgent, ChatAgentContent, ChatAgentHeader, ChatAgentInstructions, ChatAgentOutput, type ChatAgentTool, ChatAgentTools, } from "@/registry/default/ui/chat-agent"; const tools: ChatAgentTool[] = [ { name: "web_search", description: "Search the web for fresh information.", inputSchema: { type: "object", properties: { query: { type: "string" }, limit: { type: "number", default: 5 }, }, required: ["query"], }, }, { name: "read_file", description: "Read contents of a file in the workspace.", inputSchema: { type: "object", properties: { path: { type: "string" } }, required: ["path"], }, }, { name: "run_shell", description: "Execute a shell command in the project root.", }, ]; const outputSchema = `type ResearchOutput = { summary: string; sources: Array<{ title: string; url: string }>; };`; export default function Particle() { return (
You are a research assistant. Always cite sources, prefer primary documentation, and call read_file before answering questions about the codebase.
); } ``` ### p-chat-artifact-1 **Side-panel artifact container with header, content and footer** Tags: ai, chat ```tsx import { DownloadIcon, ExternalLinkIcon } from "lucide-react"; import { Button } from "@/registry/default/ui/button"; import { ChatArtifact, ChatArtifactAction, ChatArtifactActions, ChatArtifactClose, ChatArtifactContent, ChatArtifactDescription, ChatArtifactFooter, ChatArtifactHeader, ChatArtifactInfo, ChatArtifactTitle, } from "@/registry/default/ui/chat-artifact"; import { ChatCodeBlock, ChatCodeBlockActions, ChatCodeBlockCopyButton, ChatCodeBlockFilename, ChatCodeBlockHeader, } from "@/registry/default/ui/chat-code-block"; const code = `// app/products/[id]/page.tsx "use cache"; import { cacheTag } from "next/cache"; export default async function ProductPage({ params }) { const { id } = await params; cacheTag(\`product:\${id}\`); const product = await db.product.get(id); return ; }`; export default function Particle() { return (
page.tsx — Cache Components Generated by the assistant · ~32 lines · TSX
page.tsx
v3 · auto-saved 14:02
); } ``` ### p-chat-attachments-1 **Attachment chips in grid, list and inline layouts** Tags: ai, chat, chat attachments ```tsx "use client"; import { useState } from "react"; import { ChatAttachment, type ChatAttachmentData, ChatAttachments, } from "@/registry/default/ui/chat-attachments"; const initial: ChatAttachmentData[] = [ { id: "1", name: "hero.png", mediaType: "image/png", url: "https://picsum.photos/seed/jenny-hero/200/200", size: 124_503, }, { id: "2", name: "spec.pdf", mediaType: "application/pdf", size: 904_502, }, { id: "3", name: "demo.mp4", mediaType: "video/mp4", size: 4_120_400, }, { id: "4", name: "Source: nextjs.org", source: { url: "https://nextjs.org", title: "Next.js docs" }, }, ]; export default function Particle() { const [grid, setGrid] = useState(initial); const [list, setList] = useState(initial); return (

Grid (над текстом)

{grid.map((a) => ( setGrid((items) => items.filter((i) => i.id !== a.id)) } /> ))}

List (внутри prompt-input)

{list.map((a) => ( setList((items) => items.filter((i) => i.id !== a.id)) } /> ))}

Inline (в сообщении)

{initial.map((a) => ( ))}
); } ``` ### p-chat-audio-player-1 **Audio player with play/pause, seek, time and mute controls** Tags: ai, chat ```tsx import { ChatAudioPlayer } from "@/registry/default/ui/chat-audio-player"; import { ChatMessage, ChatMessageAvatar, ChatMessageContent, } from "@/registry/default/ui/chat-message"; export default function Particle() { return (

Вот текст, начитанный голосом:

); } ``` ### p-chat-canvas-1 **Agent flow graph with animated edges and card-style nodes** Tags: ai, chat ```tsx "use client"; import type { Edge, Node, NodeTypes } from "@xyflow/react"; import { Badge } from "@/registry/default/ui/badge"; import { ChatCanvas } from "@/registry/default/ui/chat-canvas"; import { ChatEdge } from "@/registry/default/ui/chat-edge"; import { ChatNode, ChatNodeAction, ChatNodeContent, ChatNodeDescription, ChatNodeHeader, ChatNodeTitle, } from "@/registry/default/ui/chat-node"; type AgentNodeData = { name: string; role: string; status: "idle" | "running" | "done"; }; const AgentNode = ({ data }: { data: AgentNodeData }) => ( {data.name} {data.role} {data.status}

Used tools · 482 tokens · last call 4s ago

); const nodeTypes: NodeTypes = { agent: AgentNode }; const edgeTypes = { animated: ChatEdge.Animated, temporary: ChatEdge.Temporary, }; const nodes: Node[] = [ { id: "planner", type: "agent", position: { x: 0, y: 0 }, data: { name: "Planner", role: "decomposes tasks", status: "done" }, }, { id: "researcher", type: "agent", position: { x: 360, y: -120 }, data: { name: "Researcher", role: "calls web_search", status: "running" }, }, { id: "coder", type: "agent", position: { x: 360, y: 120 }, data: { name: "Coder", role: "writes patches", status: "idle" }, }, { id: "reviewer", type: "agent", position: { x: 720, y: 0 }, data: { name: "Reviewer", role: "checks output", status: "idle" }, }, ]; const edges: Edge[] = [ { id: "p-r", source: "planner", target: "researcher", type: "animated" }, { id: "p-c", source: "planner", target: "coder", type: "temporary" }, { id: "r-rv", source: "researcher", target: "reviewer", type: "temporary" }, { id: "c-rv", source: "coder", target: "reviewer", type: "temporary" }, ]; export default function Particle() { return (
); } ``` ### p-chat-checkpoint-1 **Save/restore conversation checkpoint marker in timeline** Tags: ai, chat ```tsx import { ChatCheckpoint, ChatCheckpointIcon, ChatCheckpointLabel, ChatCheckpointTrigger, } from "@/registry/default/ui/chat-checkpoint"; import { ChatConversation, ChatConversationContent, } from "@/registry/default/ui/chat-conversation"; import { ChatMessage, ChatMessageAvatar, ChatMessageContent, } from "@/registry/default/ui/chat-message"; export default function Particle() { return (
Объясни Cache Components в Next.js 16. Cache Components кешируют рендер компонента через{" "} "use cache". Инвалидация — через{" "} updateTag. Saved · 14:02 Restore А как мигрировать с старого revalidate? Заменяешь старый{" "} fetch(url, { next: { revalidate } }) {" "} на "use cache" + cacheTag, и вместо TTL-инвалидации вручную дёргаешь updateTag в server action.
); } ``` ### p-chat-code-block-1 **Standalone code block with shiki, filename and copy** Tags: ai, chat, chat code block ```tsx import { ChatCodeBlock, ChatCodeBlockActions, ChatCodeBlockCopyButton, ChatCodeBlockFilename, ChatCodeBlockHeader, } from "@/registry/default/ui/chat-code-block"; const snippet = `import { ChatConversation, ChatConversationContent } from "@/components/ui/chat-conversation"; import { ChatMessage, ChatMessageContent } from "@/components/ui/chat-message"; export function Chat({ messages }) { return ( {messages.map((m) => ( {m.content} ))} ); }`; export default function Particle() { return (
Chat.tsx
); } ``` ### p-chat-commit-1 **Git commit card with author, files and additions/deletions** Tags: ai, chat ```tsx import { ChatCommit, ChatCommitActions, ChatCommitAuthor, ChatCommitAvatar, ChatCommitContent, ChatCommitCopyHashButton, ChatCommitFile, ChatCommitHash, ChatCommitHeader, ChatCommitInfo, ChatCommitMessage, ChatCommitMetadata, ChatCommitSeparator, ChatCommitTimestamp, } from "@/registry/default/ui/chat-commit"; const commitDate = new Date(Date.now() - 36 * 60 * 60 * 1000); export default function Particle() { return (
feat: introduce Cache Components primary API a1b2c3d Mikhail Vorobyov
); } ``` ### p-chat-confirmation-1 **Approve / reject tool call with pending and result states** Tags: ai, chat ```tsx "use client"; import { useState } from "react"; import { ChatConfirmation, ChatConfirmationAction, ChatConfirmationActions, type ChatConfirmationApproval, ChatConfirmationApproved, ChatConfirmationPending, ChatConfirmationReason, ChatConfirmationRejected, ChatConfirmationTitle, } from "@/registry/default/ui/chat-confirmation"; export default function Particle() { const [approval, setApproval] = useState({}); return (
Allow agent to run rm -rf node_modules?

This will delete node_modules in the project root.

setApproval({ approved: false, reason: "User cancelled the cleanup.", }) } variant="ghost" > Reject setApproval({ approved: true })} > Approve

Approved · agent is running the command.

Action rejected.

{approval.approved !== undefined ? ( ) : null}
); } ``` ### p-chat-connection-1 **MCP / tool-server connection statuses with latency** Tags: ai, chat ```tsx import { RotateCwIcon } from "lucide-react"; import { Button } from "@/registry/default/ui/button"; import { ChatConnection, ChatConnectionActions, ChatConnectionIndicator, ChatConnectionLatency, ChatConnectionName, ChatConnectionStatusLabel, } from "@/registry/default/ui/chat-connection"; export default function Particle() { return (
filesystem github postgres notion
); } ``` ### p-chat-context-1 **Token usage indicator with model breakdown popover** Tags: ai, chat ```tsx import { ChatContext, ChatContextPopup, ChatContextTrigger, } from "@/registry/default/ui/chat-context"; export default function Particle() { return (
); } ``` ### p-chat-conversation-1 **Conversation list with empty state and auto-scroll** Tags: ai, chat, chat conversation ```tsx import { MessageSquareIcon } from "lucide-react"; import { ChatConversation, ChatConversationContent, ChatConversationEmptyState, } from "@/registry/default/ui/chat-conversation"; import { ChatMessage, ChatMessageContent, } from "@/registry/default/ui/chat-message"; const messages = Array.from({ length: 8 }, (_, i) => ({ id: `m-${i}`, role: (i % 2 === 0 ? "user" : "assistant") as "user" | "assistant", content: i % 2 === 0 ? `Вопрос #${Math.floor(i / 2) + 1}: что в Jenny DS лучше всего?` : "Базовые примитивы с render-prop API и большая коллекция готовых particles.", })); export default function Particle() { return (
{messages.length === 0 ? (
); } ``` ### p-chat-environment-variables-1 **Editable env-vars list with secret masking and add/remove** Tags: ai, chat ```tsx "use client"; import { useState } from "react"; import { ChatEnvironmentVariables, type ChatEnvVariable, } from "@/registry/default/ui/chat-environment-variables"; const seed: ChatEnvVariable[] = [ { key: "DATABASE_URL", value: "postgres://localhost:5432/app", secret: true }, { key: "ANTHROPIC_API_KEY", value: "sk-ant-...", secret: true }, { key: "NODE_ENV", value: "development" }, { key: "NEXT_PUBLIC_APP_URL", value: "http://localhost:4000" }, ]; export default function Particle() { const [vars, setVars] = useState(seed); return (
); } ``` ### p-chat-file-tree-1 **Recursive workspace file tree with selection and badges** Tags: ai, chat ```tsx "use client"; import { useState } from "react"; import { ChatFileTree, ChatFileTreeFile, ChatFileTreeFolder, } from "@/registry/default/ui/chat-file-tree"; export default function Particle() { const [selected, setSelected] = useState( "apps/ui/registry/default/ui/chat-message.tsx", ); return (
setSelected(node.id)} selectedId={selected} >

Selected:{" "} {selected}

); } ``` ### p-chat-image-1 **Generated image inside an assistant message** Tags: ai, chat ```tsx import { ChatImage } from "@/registry/default/ui/chat-image"; import { ChatMessage, ChatMessageAvatar, ChatMessageContent, } from "@/registry/default/ui/chat-message"; export default function Particle() { return (

Сгенерировал концепт обложки:

); } ``` ### p-chat-inline-citation-1 **Inline citation badge with sources carousel popover** Tags: ai, chat, chat citation ```tsx import { ChatInlineCitation, ChatInlineCitationBadge, ChatInlineCitationCard, ChatInlineCitationCardBody, ChatInlineCitationCardTrigger, ChatInlineCitationCarousel, ChatInlineCitationCarouselContent, ChatInlineCitationCarouselHeader, ChatInlineCitationCarouselIndex, ChatInlineCitationCarouselItem, ChatInlineCitationCarouselNext, ChatInlineCitationCarouselPrev, ChatInlineCitationQuote, ChatInlineCitationSource, ChatInlineCitationText, } from "@/registry/default/ui/chat-inline-citation"; import { ChatMessage, ChatMessageAvatar, ChatMessageContent, } from "@/registry/default/ui/chat-message"; const cite = [ { url: "https://nextjs.org/docs/app/getting-started/cache-components", title: "Cache Components", description: "Cache Components let you cache the result of rendering a Server Component and reuse the cached output across requests.", quote: "Caching is now component-aware.", }, { url: "https://react.dev/reference/rsc/server-components", title: "Server Components — react.dev", description: "React Server Components let you render UI on the server and stream it to the client without shipping JavaScript.", quote: "Zero-bundle by default.", }, ]; export default function Particle() { return (

Cache Components в Next.js 16 расширяют RSC — они кешируют рендер компонента целиком c.url)} /> {cite.map((c) => ( {c.quote} ))} .

); } ``` ### p-chat-jsx-preview-1 **Streaming JSX rendered live with auto-closing tags** Tags: ai, chat ```tsx "use client"; import { useEffect, useState } from "react"; import { Badge } from "@/registry/default/ui/badge"; import { Button } from "@/registry/default/ui/button"; import { ChatJsxPreview } from "@/registry/default/ui/chat-jsx-preview"; const final = `

Cache Components

New

Cache the rendered output of any Server Component with the "use cache" directive.

`; export default function Particle() { const [jsx, setJsx] = useState(""); const [streaming, setStreaming] = useState(true); useEffect(() => { let i = 0; const id = setInterval(() => { i = Math.min(i + 18, final.length); setJsx(final.slice(0, i)); if (i >= final.length) { setStreaming(false); clearInterval(id); } }, 60); return () => clearInterval(id); }, []); return (

{streaming ? "Streaming… auto-closes pending tags as they arrive." : "Final JSX rendered."}

); } ``` ### p-chat-loader-1 **Shimmer-animated text loaders at different speeds** Tags: ai, chat, chat loader ```tsx import { ChatLoader } from "@/registry/default/ui/chat-loader"; export default function Particle() { return (
Thinking… Searching the web Generating a longer plan across multiple subtasks…
); } ``` ### p-chat-message-1 **Messages by role (user, assistant, system) with actions** Tags: ai, chat, chat message ```tsx import { CopyIcon, RotateCcwIcon } from "lucide-react"; import { ChatMessage, ChatMessageAction, ChatMessageActions, ChatMessageAvatar, ChatMessageContent, ChatMessageToolbar, } from "@/registry/default/ui/chat-message"; export default function Particle() { return (
Сравни Jenny DS и shadcn/ui Jenny построен на Base UI (Radix-преемник), использует `render` prop вместо `asChild` и идёт с большой коллекцией particles. Установка и темизация совместимы с shadcn CLI. Системное сообщение: модель переключена на claude-opus-4.7
); } ``` ### p-chat-mic-selector-1 **Microphone device picker from enumerateDevices** Tags: ai, chat ```tsx "use client"; import { useState } from "react"; import { type ChatMicDevice, ChatMicSelector, } from "@/registry/default/ui/chat-mic-selector"; const fallbackDevices: ChatMicDevice[] = [ { deviceId: "default", label: "Default — System default" }, { deviceId: "macbook", label: "MacBook Pro Microphone" }, { deviceId: "usb", label: "Blue Yeti USB" }, ]; export default function Particle() { const [device, setDevice] = useState("default"); return (

Demo uses fallback devices (no live mic permission in particle preview).

Selected:{" "} {device ?? "—"}

); } ``` ### p-chat-model-selector-1 **Standalone model picker grouped by provider with disabled tiers** Tags: ai, chat ```tsx "use client"; import { useState } from "react"; import { type ChatModelOption, ChatModelSelector, } from "@/registry/default/ui/chat-model-selector"; const models: ChatModelOption[] = [ { id: "claude-opus-4-7", name: "Claude Opus 4.7", description: "Best for complex reasoning · 200K context", provider: "Anthropic", }, { id: "claude-sonnet-4-7", name: "Claude Sonnet 4.7", description: "Balanced speed and quality", provider: "Anthropic", }, { id: "claude-haiku-4-7", name: "Claude Haiku 4.7", description: "Fastest · cheapest", provider: "Anthropic", }, { id: "gpt-5", name: "GPT-5", description: "OpenAI flagship", provider: "OpenAI", }, { id: "gpt-5-mini", name: "GPT-5 mini", description: "Faster, smaller", provider: "OpenAI", }, { id: "llama-4-70b", name: "Llama 4 70B", description: "Self-hosted (currently scaling)", disabled: true, provider: "Local", }, ]; export default function Particle() { const [model, setModel] = useState("claude-opus-4-7"); return (

Selected: {model}

); } ``` ### p-chat-open-in-chat-1 **Open the current prompt in ChatGPT, Claude, Cursor, GitHub or Google** Tags: ai, chat ```tsx import { ChatOpenIn, ChatOpenInChatGPT, ChatOpenInClaude, ChatOpenInCursor, ChatOpenInGitHub, ChatOpenInGoogle, ChatOpenInPopup, ChatOpenInSeparator, ChatOpenInTrigger, } from "@/registry/default/ui/chat-open-in-chat"; const lastMessage = "Объясни, как мигрировать с revalidate на Cache Components в Next.js 16"; export default function Particle() { return (

Текущий промпт:{" "} «{lastMessage}»

); } ``` ### p-chat-package-info-1 **npm package upgrade cards with change-type badges** Tags: ai, chat ```tsx import { ChatPackageInfo, ChatPackageInfoContent, ChatPackageInfoDependencies, ChatPackageInfoDependency, ChatPackageInfoDescription, } from "@/registry/default/ui/chat-package-info"; export default function Particle() { return (
The React framework for the web. Now with Cache Components and Turbopack by default. Utility-first CSS framework — v4 brings a faster engine and zero config. Role-aware chat message bubble from Jenny DS AI Components. Replaced by built-in React 19 cache primitives.
); } ``` ### p-chat-panel-1 **Workspace split with a settings panel beside the chat** Tags: ai, chat ```tsx import { Button } from "@/registry/default/ui/button"; import { ChatPanel, ChatPanelActions, ChatPanelClose, ChatPanelContent, ChatPanelDescription, ChatPanelFooter, ChatPanelHeader, ChatPanelTitle, } from "@/registry/default/ui/chat-panel"; export default function Particle() { return (
Main chat area (placeholder)
Agent settings Tune the active agent for this session
v3 · synced
); } ``` ### p-chat-persona-1 **Persona switcher with avatar states and animated rings** Tags: ai, chat ```tsx "use client"; import { useState } from "react"; import { ChatPersona, ChatPersonaAvatar, ChatPersonaInfo, ChatPersonaName, type ChatPersonaOption, type ChatPersonaState, ChatPersonaStateLabel, ChatPersonaSwitcher, } from "@/registry/default/ui/chat-persona"; const personas: ChatPersonaOption[] = [ { id: "research", name: "Researcher", description: "Cites every claim", fallback: "R", }, { id: "code", name: "Code reviewer", description: "Spots bugs early", fallback: "C", }, { id: "writer", name: "Writer", description: "Polishes prose", fallback: "W", }, ]; const states: ChatPersonaState[] = [ "idle", "listening", "thinking", "speaking", "asleep", ]; export default function Particle() { const [active, setActive] = useState("research"); const persona = personas.find((p) => p.id === active) ?? personas[0] ?? { id: "fallback", name: "Persona", fallback: "?" }; return (
setActive(id)} personas={personas} value={active} />
{states.map((state) => ( {persona.name} ))}
); } ``` ### p-chat-plan-1 **Upfront agent plan with shimmer-loaded title and steps** Tags: ai, chat ```tsx "use client"; import { useEffect, useState } from "react"; import { ChatPlan, ChatPlanAction, ChatPlanContent, ChatPlanDescription, ChatPlanHeader, ChatPlanStep, ChatPlanTitle, ChatPlanTrigger, } from "@/registry/default/ui/chat-plan"; const steps = [ "Read existing data-fetching layer", "Identify revalidate call sites", "Rewrite with cacheTag + updateTag", "Update tests and CI", "Open a draft PR", ]; export default function Particle() { const [streaming, setStreaming] = useState(true); useEffect(() => { const id = setTimeout(() => setStreaming(false), 2200); return () => clearTimeout(id); }, []); return (
Implement Cache Components migration Replace revalidate-based fetches with the new `"use cache"` directive across the dashboard app.
{steps.map((step, i) => ( {step} ))}
); } ``` ### p-chat-prompt-input-1 **Prompt input with attach and voice tools** Tags: ai, chat, chat prompt ```tsx "use client"; import { MicIcon, PaperclipIcon } from "lucide-react"; import { useState } from "react"; import { Button } from "@/registry/default/ui/button"; import { ChatPromptInput, ChatPromptInputSubmit, ChatPromptInputTextarea, ChatPromptInputToolbar, ChatPromptInputTools, } from "@/registry/default/ui/chat-prompt-input"; export default function Particle() { const [sent, setSent] = useState(null); return (
{sent ? (

Отправлено:{" "} {sent}

) : null}
); } ``` ### p-chat-queue-1 **Agent task queue with pending, running, completed sections** Tags: ai, chat ```tsx import { ChatQueue, ChatQueueItem, ChatQueueItemAction, ChatQueueItemActions, ChatQueueItemAttachments, ChatQueueItemDescription, ChatQueueItemFile, ChatQueueItemIndicator, ChatQueueItemRow, ChatQueueItemTitle, ChatQueueSection, ChatQueueSectionContent, ChatQueueSectionTrigger, } from "@/registry/default/ui/chat-queue"; export default function Particle() { return (
Refactor auth middleware Make rateLimit throw 429 when quota is exhausted app/api/auth/route.ts app/api/auth/rate-limit.ts Add migration for new sessions table Set up monorepo and turbo Migrate Tailwind to v4 Deploy preview for #482 Build failed — see logs
); } ``` ### p-chat-reasoning-1 **Streaming reasoning block that auto-opens then auto-closes** Tags: ai, chat, chat reasoning ```tsx "use client"; import { useEffect, useState } from "react"; import { ChatMessage, ChatMessageAvatar, ChatMessageContent, } from "@/registry/default/ui/chat-message"; import { ChatReasoning, ChatReasoningContent, ChatReasoningTrigger, } from "@/registry/default/ui/chat-reasoning"; import { ChatResponse } from "@/registry/default/ui/chat-response"; const reasoning = `Пользователь сравнивает Next.js Cache Components с старым **revalidate**. 1. Определю различия: \`use cache\` directive против \`fetch({ next: { revalidate } })\`. 2. Уточню зону применения — компоненты vs запросы. 3. Дам короткий пример с \`updateTag\`.`; const answer = `**Cache Components** — это явное кеширование на уровне компонентов через \`"use cache"\`. В отличие от \`revalidate\` они кешируют рендер целиком (вместе с дочерними), а инвалидация — через \`updateTag\` / \`updateCache\`.`; export default function Particle() { const [isStreaming, setIsStreaming] = useState(true); useEffect(() => { const t = setTimeout(() => setIsStreaming(false), 2200); return () => clearTimeout(t); }, []); return (
{reasoning} {isStreaming ? null : {answer}}
); } ``` ### p-chat-response-1 **Streaming markdown response with code, math, tables** Tags: ai, chat, chat response ```tsx import { ChatMessage, ChatMessageAvatar, ChatMessageContent, } from "@/registry/default/ui/chat-message"; import { ChatResponse } from "@/registry/default/ui/chat-response"; const markdown = `## Markdown стриминг Этот блок отрендерен через **\`ChatResponse\`** (обёртка над \`streamdown\`). Поддерживает: - GFM-таблицы и чек-листы - code blocks с подсветкой - math \`E = mc^2\` - mermaid диаграммы \`\`\`tsx import { ChatResponse } from "@/components/ui/chat-response"; {streamingText} \`\`\` > Безопасно прокидывать **частичные** строки — рендер инкрементальный.`; export default function Particle() { return (
{markdown}
); } ``` ### p-chat-sandbox-1 **Sandboxed code preview with Code, Preview, Console tabs** Tags: ai, chat ```tsx import { ChatCodeBlock, ChatCodeBlockActions, ChatCodeBlockCopyButton, ChatCodeBlockFilename, ChatCodeBlockHeader, } from "@/registry/default/ui/chat-code-block"; import { ChatSandbox, ChatSandboxContent, ChatSandboxFrame, ChatSandboxHeader, ChatSandboxTab, ChatSandboxTabPanel, ChatSandboxTabs, ChatSandboxTabsBar, ChatSandboxTabsList, } from "@/registry/default/ui/chat-sandbox"; import { ChatTerminal } from "@/registry/default/ui/chat-terminal"; const code = `export default function App() { return (

Hello from the sandbox

); }`; const consoleLog = [ "\x1b[2m> \x1b[0mvite dev", " \x1b[32m✓\x1b[0m Local: http://localhost:5173/", " \x1b[32m✓\x1b[0m ready in 248ms", "", "\x1b[33m! \x1b[0mHMR connected", ].join("\n"); export default function Particle() { return (
Preview Code Console
App.tsx
); } ``` ### p-chat-schema-display-1 **API endpoint schema with method, path and parameter sections** Tags: ai, chat ```tsx import { ChatSchemaDisplay, ChatSchemaDisplayContent, ChatSchemaDisplayDescription, ChatSchemaDisplayHeader, ChatSchemaDisplayMethod, ChatSchemaDisplayPath, ChatSchemaParameter, ChatSchemaSection, } from "@/registry/default/ui/chat-schema-display"; export default function Particle() { return (
/api/sessions Create a new chat session and return its identifier. Requires an authenticated user.
); } ``` ### p-chat-snippet-1 **Copyable shell-command snippet lines** Tags: ai, chat ```tsx import { ChatSnippet } from "@/registry/default/ui/chat-snippet"; export default function Particle() { return (
); } ``` ### p-chat-sources-1 **Collapsible used-sources list under an assistant reply** Tags: ai, chat, chat sources ```tsx import { ChatMessage, ChatMessageAvatar, ChatMessageContent, } from "@/registry/default/ui/chat-message"; import { ChatSource, ChatSources, ChatSourcesContent, ChatSourcesTrigger, } from "@/registry/default/ui/chat-sources"; const sources = [ { title: "Next.js Cache Components", href: "https://nextjs.org/docs/app/api-reference/directives/use-cache", }, { title: "React Server Components", href: "https://react.dev/reference/rsc/server-components", }, { title: "Base UI", href: "https://base-ui.com/" }, ]; export default function Particle() { return (

Next.js 16 поддерживает Cache Components — мощную замену старому кешированию. RSC при этом остаются базой для рендера.

{sources.map((s) => ( ))}
); } ``` ### p-chat-speech-input-1 **Push-to-talk mic with Web Speech and MediaRecorder fallback** Tags: ai, chat ```tsx "use client"; import { useState } from "react"; import { Button } from "@/registry/default/ui/button"; import { ChatSpeechInput, type ChatSpeechInputStatus, } from "@/registry/default/ui/chat-speech-input"; export default function Particle() { const [text, setText] = useState(""); const [status, setStatus] = useState("idle"); return (
setText(value)} />

Status: {status}

{text || ( Press the mic and start speaking. (Web Speech API works in Chrome / Edge; Safari and Firefox use the MediaRecorder fallback — wire up `onAudioRecorded`.) )}

); } ``` ### p-chat-stack-trace-1 **Parsed Node stack trace with clickable frames** Tags: ai, chat ```tsx import { ChatStackTrace } from "@/registry/default/ui/chat-stack-trace"; const trace = `TypeError: Cannot read properties of undefined (reading 'theme') at applyTheme (app/lib/theme.ts:42:18) at Object.useEffect (app/components/ThemedRoot.tsx:24:5) at commitHookEffectListMount (node_modules/react-dom/cjs/react-dom.development.js:23150:26) at commitPassiveMountEffects (node_modules/react-dom/cjs/react-dom.development.js:24927:13) at flushPassiveEffectsImpl (node_modules/react-dom/cjs/react-dom.development.js:27039:15) at internal/process/task_queues:96:7`; export default function Particle() { return (
); } ``` ### p-chat-suggestion-1 **Horizontal suggestion chips above the prompt input** Tags: ai, chat, chat suggestion ```tsx "use client"; import { useState } from "react"; import { ChatSuggestion, ChatSuggestions, } from "@/registry/default/ui/chat-suggestion"; const items = [ "Напиши план продукта", "Объясни как ребёнку", "Найди ошибку в коде", "Подведи итог встречи", "Сравни два варианта", "Покажи примеры использования", ]; export default function Particle() { const [picked, setPicked] = useState(null); return (
{items.map((s) => ( ))}

Выбрано:{" "} {picked ?? "—"}

); } ``` ### p-chat-task-1 **Multi-step agent task list with file chips and statuses** Tags: ai, chat ```tsx import { ChatMessage, ChatMessageAvatar, ChatMessageContent, } from "@/registry/default/ui/chat-message"; import { ChatTask, ChatTaskContent, ChatTaskFile, ChatTaskItem, ChatTaskTrigger, } from "@/registry/default/ui/chat-task"; export default function Particle() { return (
Read{" "} apps/ui/registry/default/ui/button.tsx Read{" "} apps/ui/registry/default/ui/chat-message.tsx Searched for data-slot usage across primitives Drafting summary of the convention Generate code example
); } ``` ### p-chat-terminal-1 **ANSI-coloured terminal output with autoscroll and copy** Tags: ai, chat ```tsx "use client"; import { useState } from "react"; import { ChatTerminal } from "@/registry/default/ui/chat-terminal"; const initialOutput = [ "\x1b[2m$\x1b[0m bun run build", "\x1b[36m▲\x1b[0m Next.js 16.1.7", "", " \x1b[32m✓\x1b[0m Compiled successfully in \x1b[1m4.8s\x1b[0m", " \x1b[32m✓\x1b[0m Collecting page data", " \x1b[32m✓\x1b[0m Generating static pages \x1b[2m(564/564)\x1b[0m", "", "Route (app) \x1b[2mSize First Load JS\x1b[0m", "\x1b[2m┌\x1b[0m ○ / 142 B 92.4 kB", "\x1b[2m├\x1b[0m ○ /docs 1.18 kB 98.1 kB", "\x1b[2m└\x1b[0m ● /docs/ai/[component] 523 B 93.8 kB", "", "\x1b[32m✓\x1b[0m Build complete", "\x1b[33m!\x1b[0m 2 warnings", ].join("\n"); export default function Particle() { const [output, setOutput] = useState(initialOutput); return (
setOutput("")} output={output} />
); } ``` ### p-chat-test-results-1 **Test runner output with suites, summary and failure details** Tags: ai, chat ```tsx import { ChatTest, ChatTestError, ChatTestResults, ChatTestResultsHeader, ChatTestResultsProgress, ChatTestResultsSummary, ChatTestSuite, } from "@/registry/default/ui/chat-test-results"; export default function Particle() { return (
{`AssertionError: expected 429, got 200 at Object. (auth.test.ts:84:14) at expect (node_modules/vitest/dist/index.js:32:11)`} {`TypeError: streamdown is not a function at ChatResponse (registry/default/ui/chat-response.tsx:9:5)`}
); } ``` ### p-chat-tool-1 **Tool call render with parameters JSON and result** Tags: ai, chat ```tsx import { ChatMessage, ChatMessageAvatar, ChatMessageContent, } from "@/registry/default/ui/chat-message"; import { ChatTool, ChatToolContent, ChatToolHeader, ChatToolInput, ChatToolOutput, } from "@/registry/default/ui/chat-tool"; const output = { results: [ { title: "Cache Components — Next.js docs", url: "https://nextjs.org/docs/app/getting-started/cache-components", snippet: "Cache Components let you cache the result of rendering a Server Component and reuse it across requests.", }, { title: "use cache directive", url: "https://nextjs.org/docs/app/api-reference/directives/use-cache", snippet: "Mark a component as cacheable. Invalidate via updateTag or updateCache.", }, ], }; export default function Particle() { return (
); } ``` ### p-chat-transcription-1 **Click-to-seek STT transcription synced with playback** Tags: ai, chat ```tsx "use client"; import { useEffect, useState } from "react"; import { ChatTranscription, type ChatTranscriptionSegment, } from "@/registry/default/ui/chat-transcription"; const segments: ChatTranscriptionSegment[] = [ { text: "Привет!", startSecond: 0, endSecond: 0.6 }, { text: "Я", startSecond: 0.7, endSecond: 0.9 }, { text: "помогу", startSecond: 1.0, endSecond: 1.4 }, { text: "тебе", startSecond: 1.5, endSecond: 1.8 }, { text: "разобраться", startSecond: 1.9, endSecond: 2.6 }, { text: "с", startSecond: 2.7, endSecond: 2.9 }, { text: "Cache", startSecond: 3.0, endSecond: 3.4 }, { text: "Components", startSecond: 3.5, endSecond: 4.2 }, { text: "в", startSecond: 4.3, endSecond: 4.5 }, { text: "Next.js", startSecond: 4.6, endSecond: 5.2 }, { text: "16.", startSecond: 5.3, endSecond: 5.7 }, ]; export default function Particle() { const [time, setTime] = useState(0); useEffect(() => { const id = setInterval(() => { setTime((t) => (t > 6 ? 0 : t + 0.1)); }, 100); return () => clearInterval(id); }, []); return (

Playback: {time.toFixed(1)}s

); } ``` ### p-chat-voice-selector-1 **TTS voice picker with provider and language metadata** Tags: ai, chat ```tsx "use client"; import { useState } from "react"; import { type ChatVoice, ChatVoiceSelector, } from "@/registry/default/ui/chat-voice-selector"; const voices: ChatVoice[] = [ { id: "alloy", name: "Alloy", lang: "en-US", provider: "OpenAI" }, { id: "echo", name: "Echo", lang: "en-US", provider: "OpenAI" }, { id: "shimmer", name: "Shimmer", lang: "en-US", provider: "OpenAI" }, { id: "fable", name: "Fable", lang: "en-GB", provider: "OpenAI" }, { id: "polly-tatyana", name: "Tatyana", lang: "ru-RU", provider: "Polly" }, { id: "polly-maxim", name: "Maxim", lang: "ru-RU", provider: "Polly" }, ]; export default function Particle() { const [voice, setVoice] = useState("alloy"); return (

Selected:{" "} {voice ?? "—"}

); } ``` ### p-chat-web-preview-1 **Iframe web preview with URL bar, back/forward, refresh** Tags: ai, chat ```tsx import { ChatWebPreview, ChatWebPreviewBody, ChatWebPreviewNav, ChatWebPreviewOpen, ChatWebPreviewRefresh, ChatWebPreviewToolbar, ChatWebPreviewUrlInput, } from "@/registry/default/ui/chat-web-preview"; export default function Particle() { return (
); } ``` ## alert (7) ### p-alert-1 **Basic alert** ```tsx import { Alert, AlertDescription, AlertTitle, } from "@/registry/default/ui/alert"; export default function Particle() { return ( Heads up!

Describe what can be done about it here.

); } ``` ### p-alert-2 **Alert with icon** ```tsx import { InfoIcon } from "lucide-react"; import { Alert, AlertDescription, AlertTitle, } from "@/registry/default/ui/alert"; export default function Particle() { return ( Heads up! Describe what can be done about it here. ); } ``` ### p-alert-3 **Alert with icon and action buttons** ```tsx import { InfoIcon } from "lucide-react"; import { Alert, AlertAction, AlertDescription, AlertTitle, } from "@/registry/default/ui/alert"; import { Button } from "@/registry/default/ui/button"; export default function Particle() { return ( Heads up! Describe what can be done about it here. ); } ``` ### p-alert-4 **Info alert** Tags: alert, info ```tsx import { InfoIcon } from "lucide-react"; import { Alert, AlertDescription, AlertTitle, } from "@/registry/default/ui/alert"; export default function Particle() { return ( Heads up! Describe what can be done about it here. ); } ``` ### p-alert-5 **Success alert** Tags: alert, success ```tsx import { CircleCheckIcon } from "lucide-react"; import { Alert, AlertDescription, AlertTitle, } from "@/registry/default/ui/alert"; export default function Particle() { return ( Heads up! Describe what can be done about it here. ); } ``` ### p-alert-6 **Warning alert** Tags: alert, warning ```tsx import { TriangleAlertIcon } from "lucide-react"; import { Alert, AlertDescription, AlertTitle, } from "@/registry/default/ui/alert"; export default function Particle() { return ( Heads up! Describe what can be done about it here. ); } ``` ### p-alert-7 **Error alert** Tags: alert, error ```tsx import { CircleAlertIcon } from "lucide-react"; import { Alert, AlertDescription, AlertTitle, } from "@/registry/default/ui/alert"; export default function Particle() { return ( Heads up! Describe what can be done about it here. ); } ``` ## alert dialog (3) ### p-alert-dialog-1 **Alert dialog** Tags: alert dialog, dialog ```tsx import { AlertDialog, AlertDialogClose, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPopup, AlertDialogTitle, AlertDialogTrigger, } from "@/registry/default/ui/alert-dialog"; import { Button } from "@/registry/default/ui/button"; export default function Particle() { return ( }> Delete Account Are you absolutely sure? This action cannot be undone. This will permanently delete your account and remove your data from our servers. }> Cancel }> Delete Account ); } ``` ### p-alert-dialog-2 **Alert dialog with bare footer** Tags: alert dialog, dialog ```tsx import { AlertDialog, AlertDialogClose, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPopup, AlertDialogTitle, AlertDialogTrigger, } from "@/registry/default/ui/alert-dialog"; import { Button } from "@/registry/default/ui/button"; export default function Particle() { return ( }> Delete Account Are you absolutely sure? This action cannot be undone. This will permanently delete your account and remove your data from our servers. }> Cancel }> Delete Account ); } ``` ### p-dialog-4 **Dialog with close confirmation** Tags: alert dialog, dialog ```tsx "use client"; import { useState } from "react"; import { AlertDialog, AlertDialogClose, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPopup, AlertDialogTitle, } from "@/registry/default/ui/alert-dialog"; import { Button } from "@/registry/default/ui/button"; import { Dialog, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogPopup, DialogTitle, DialogTrigger, } from "@/registry/default/ui/dialog"; import { Field } from "@/registry/default/ui/field"; import { Form } from "@/registry/default/ui/form"; import { Textarea } from "@/registry/default/ui/textarea"; export default function Particle() { const [dialogOpen, setDialogOpen] = useState(false); const [confirmOpen, setConfirmOpen] = useState(false); const [value, setValue] = useState(""); return ( { if (!o && value) { setConfirmOpen(true); } else { setDialogOpen(o); } }} open={dialogOpen} > }> Compose New message Type something and try closing.
{ event.preventDefault(); // Close the dialog when submitting setDialogOpen(false); }} >