A model switcher for AI chat inputs that unfolds out of its own pill into a searchable list.
Click the pill and the list unfolds around it, with the current model staying exactly where the pill was. Hover or use the arrow keys and a soft highlight slides along, while the footer shows what that model is good at. Type to filter. Pick one and the list folds away around it, carrying that row down into the pill. Escape or a click outside folds it back onto the current model.
Options you can pass to customize this component.
models*PickerModel[]The models to list, in order. Each has an id and name, plus an optional provider to group by, icon, description, and speed and intelligence from 1 to 5.
valuestringThe selected model id, for controlled use.
defaultValuestringThe model selected on first render. Defaults to the first model.
onChange(id: string) => voidCalled with the new id when a different model is picked.
searchablebooleanShows a search field at the top of the list.
classNamestringExtra classes merged onto the root element (data-slot="model-picker").
npx shadcn@latest add swamimalode07/rare-ui/model-picker"use client"import { useState } from "react"import { ModelPicker, type PickerModel } from "@/components/ui/model-picker"const models: PickerModel[] = [{ id: "opus", name: "Claude Opus 5.5", provider: "Anthropic", description: "Most capable", speed: 2, intelligence: 5 },{ id: "sonnet", name: "Claude Sonnet 5.5", provider: "Anthropic", description: "Smart and quick", speed: 4, intelligence: 4 },{ id: "haiku", name: "Claude Haiku 5.5", provider: "Anthropic", description: "Fastest", speed: 5, intelligence: 3 },]export function Toolbar() {const [model, setModel] = useState("opus")return <ModelPicker models={models} value={model} onChange={setModel} />}
Click the code icon in the top-right corner to view the source code.
Most components here are recreations of great work from around the web. I don't claim to be the original creator - this is my attempt to reverse-engineer, replicate, and often add a few extra features. I've tried to credit everyone; if I missed someone, let me know.
1
Ask anything