Компоненты
- Accordion
- Alert
- Alert Dialog
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Button
- Calendar
- Card
- Checkbox
- Checkbox Group
- Collapsible
- Combobox
- Command
- Date Picker
- Dialog
- DrawerNew
- Empty
- Field
- Fieldset
- Form
- Frame
- Group
- Input
- Input Group
- Kbd
- Label
- Menu
- Meter
- Number Field
- OTP FieldNew
- Pagination
- Popover
- Preview Card
- Progress
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Toolbar
- Tooltip
AI Components
- AI Components
- Chat Conversation
- Chat Message
- Chat Response
- Chat Suggestion
- Chat Prompt Input
- Chat Attachments
- Chat Code Block
- Chat Image
- Chat Inline Citation
- Chat Reasoning
- Chat Sources
- Chat Actions
- Chat Context
- Chat Loader
- Chat Task
- Chat Tool
- Chat Web Preview
- 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 Queue
- Chat Checkpoint
- Chat Confirmation
- Chat Artifact
- Chat JSX Preview
- Chat Schema Display
- Chat Package Info
- Chat Commit
- Chat Plan
- Chat Panel
- Chat Open In Chat
- Chat Sandbox
- Chat Model Selector
- Chat Canvas
- Chat Node
- Chat Edge
Resources
Chat Model Selector
Полноразмерный picker модели с группировкой по провайдерам, описанием и иконкой.
Selected: claude-opus-4-7
"use client";
import { useState } from "react";
import {
type ChatModelOption,
ChatModelSelector,
} from "@/components/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 (
<div className="flex w-full max-w-md flex-col gap-3 p-4">
<ChatModelSelector
models={models}
onValueChange={setModel}
size="md"
value={model}
/>
<p className="text-muted-foreground text-xs">
Selected: <span className="font-mono text-foreground">{model}</span>
</p>
</div>
);
}
Installation
pnpm dlx shadcn@latest add @jenny/chat-model-selector
Usage
import {
type ChatModelOption,
ChatModelSelector,
} from "@/components/ui/chat-model-selector";
const models: ChatModelOption[] = [
{
id: "claude-opus-4-7",
name: "Claude Opus 4.7",
description: "Best for complex reasoning",
provider: "Anthropic",
},
{
id: "claude-sonnet-4-7",
name: "Claude Sonnet 4.7",
description: "Balanced speed and quality",
provider: "Anthropic",
},
{
id: "gpt-5",
name: "GPT-5",
description: "OpenAI flagship",
provider: "OpenAI",
},
{
id: "llama-4",
name: "Llama 4 70B",
description: "Self-hosted",
provider: "Local",
disabled: true,
},
];
<ChatModelSelector
models={models}
onValueChange={(id, model) => setModel(id)}
value={modelId}
/>vs встроенный selector в chat-prompt-input
ChatPromptInputModelSelect(вchat-prompt-input) — компактный inline-trigger без border, для toolbar внутри ввода.ChatModelSelector(standalone) — полноразмерный с группировкой поprovider, иконками, описаниями. Для settings sheet, model comparison view, верхней панели чата.
Размер триггера: size="sm" | "md" | "lg" (по умолчанию md = h-9).