Themes
- Default
- Catppuccin
- Dracula
- High Contrast
- High Contrast Light
- Monokai
- Nord
- One Dark
- Solarized
- Tokyo Night
- AMOLED
- Aura
- Ayu
- Carbonfox
- Catppuccin Frappe
- Catppuccin Macchiato
- Cobalt2
- Cursor
- Everforest
- Flexoki
- GitHub
- Gruvbox
- Kanagawa
- Lucent Orng
- Material
- Matrix
- Mercury
- Night Owl
- OC-2
- One Dark Pro
- OpenCode
- Orng
- Osaka Jade
- Palenight
- Rose Pine
- Shades of Purple
- Synthwave '84
- Vercel
- Vesper
- Zenburn
Utility
AI
Terminal
model-selector-demo
No opentui live preview is registered for this example yet.
Installation
$ pnpm dlx shadcn@latest add @termcn/opentui-model-selector
Usage
import { ModelSelector } from "@/components/ui/model-selector";<ModelSelector
models={[
{ id: "gpt-4o", name: "GPT-4o", provider: "OpenAI", context: 128000 },
{
id: "claude-3-5-sonnet",
name: "Claude 3.5 Sonnet",
provider: "Anthropic",
context: 200000,
},
]}
selected="gpt-4o"
onSelect={(id) => console.log("selected", id)}
/>API Reference
ModelSelector
| Prop | Type | Default |
|---|---|---|
models | ModelOption[] | required |
selected | string | required |
onSelect | (id: string) => void | required |
showContext | boolean | true |
showProvider | boolean | true |
groupByProvider | boolean | false |