Обзор
Компоненты
- Accordion
- Alert
- Alert Dialog
- Autocomplete
- Auth Surface
- Avatar
- Badge
- Browse Catalog Dialog
- Button
- Card
- Checkbox
- Checkbox Group
- Collapsible
- Combobox
- Command
- Connector Setup Dialog
- Cookie Banner
- Dialog
- Directory Card
- Directory Detail
- Directory Skeleton
- DrawerНовое
- Token Parts Input
- Empty
- Field
- Fieldset
- File Preview Modal
- File Preview Skeleton
- Form
- Frame
- Group
- Icon
- Input
- Input Group
- Kbd
- Label
- Legal Shell
- Menu
- Mermaid Diagram
- Mind Map Diagram
- Not Found Screen
- Onboarding Frame
- Popover
- PDF Thumbnail
- Personalization Landing
- Preview Card
- Pricing Page
- Progress
- Radio Group
- Ring Spinner
- Scroll Area
- Select
- Separator
- Settings Page
- Settings Skills
- Settings Connectors
- Settings Capabilities
- Settings Usage
- Settings Account
- Settings Billing
- Sheet
- Sidebar
- Skeleton
- Skill Create Dialog
- Slider
- Spinner
- Stat
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Tooltip
AI-компоненты
- Компоненты AI
- Chat Conversation
- Chat Message
- Chat Response
- Chat Suggestion
- Chat Prompt Input
- Slash Highlighted Textarea
- Chat Search Dialog
- Chat Skill Doc
- Chat Connector Detail
- Chat Attachments
- Chat File Card
- Chat Token Chip
- Chat Code Block
- Chat Image
- Chat Inline Citation
- Chat Sources
- Chat Web Search
- Chat Research
- Chat Source
- Chat Actions
- Chat Context
- Chat Loader
- Chat Compaction
- Chat Timeline
- Chat Snippet
- Chat Terminal
- Chat Stack Trace
- Chat Test Results
- Chat File Tree
- Chat Environment Variables
- Chat Audio Player
- Chat Transcription
- Chat Speech Input
- Chat Mic Selector
- Chat Voice Selector
- Chat Agent
- Chat Persona
- Chat Connection
- Chat Connector Suggestion
- Chat Queue
- Chat Checkpoint
- Chat Confirmation
- Chat Artifact
- Chat JSX Preview
- Chat Schema Display
- Chat Package Info
- Chat Commit
- Chat Plan
- Chat Open In Chat
- Chat Sandbox
- Chat Model Selector
- Chat Canvas
- Chat Node
- Chat Edge
Ресурсы
Chat Sources
Сворачиваемый список источников / цитат, использованных моделью.
J
Next.js 16 поддерживает Cache Components — мощную замену старому кешированию. RSC при этом остаются базой для рендера.
import {
ChatMessage,
ChatMessageAvatar,
ChatMessageContent,
} from "@/components/ui/chat-message";
import {
ChatSource,
ChatSources,
ChatSourcesContent,
ChatSourcesTrigger,
} from "@/components/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 (
<div className="w-full max-w-2xl p-4">
<ChatMessage from="assistant">
<ChatMessageAvatar fallback="J" />
<ChatMessageContent>
<p>
Next.js 16 поддерживает Cache Components — мощную замену старому
кешированию. RSC при этом остаются базой для рендера.
</p>
<ChatSources defaultOpen>
<ChatSourcesTrigger count={sources.length} />
<ChatSourcesContent>
{sources.map((s) => (
<ChatSource href={s.href} key={s.href} title={s.title} />
))}
</ChatSourcesContent>
</ChatSources>
</ChatMessageContent>
</ChatMessage>
</div>
);
}
Установка
pnpm dlx shadcn@latest add @oracul/chat-sources
Использование
import {
ChatSource,
ChatSources,
ChatSourcesContent,
ChatSourcesTrigger,
} from "@/components/ui/chat-sources";
<ChatSources>
<ChatSourcesTrigger count={3} />
<ChatSourcesContent>
<ChatSource href="https://nextjs.org/docs" title="Next.js docs" />
<ChatSource href="https://react.dev" title="React" />
<ChatSource href="https://base-ui.com" title="Base UI" />
</ChatSourcesContent>
</ChatSources>API
| Компонент | Описание |
|---|---|
ChatSources | Корень. Collapsible внутри. |
ChatSourcesTrigger | Кнопка-триггер. count показывает «Used N sources». |
ChatSourcesContent | Сворачиваемый контейнер. |
ChatSource | Ссылка <a> на источник. Передай href, title, hostname или собственный children. |
На этой странице