Skip to content
ComposerModel pickerMenu

Model picker

Model menu for the composer footer, grouped by provider, with search, capability glyphs, a New tag and your own provider marks.

Grouped by provider with search, capability glyphs and a New tag.

Installation

$ pnpm dlx shadcn@latest add https://chatcn.dev/r/model-picker.json

Usage

tsx
import { ModelPicker } from "@/components/ui/chatcn/model-picker"

<ModelPicker
  models={[
    {
      id: "claude-sonnet-4-5",
      name: "Claude Sonnet 4.5",
      provider: "anthropic",
      description: "Fast and strong at code",
      capabilities: ["vision", "tools", "reasoning"],
    },
  ]}
  providers={[{ id: "anthropic", name: "Anthropic" }]}
  value={model}
  onValueChange={setModel}
  renderProviderMark={(id) => <ProviderLogo id={id} />}
/>

chatcn bundles no provider logos. Supply your own marks through renderProviderMark, within each provider's brand guidelines.

Examples

States

Default and small triggers, loading and disabled.

Props

PropTypeNotes
modelsModelOption[]id, name, provider, description, capabilities, isNew, disabled, disabledReason
providers{ id, name }[]Group names and order
value, defaultValue, onValueChangestring
renderProviderMark(providerId) => ReactNode16 px node for trigger and group labels
loading, disabledboolean
size"sm" | "md"28 or 32 px trigger
side, alignFlips when there is no room
showLegendbooleanCapability legend under the list. Default true

Keyboard

KeyAction
TypingFilters by name, provider, description or capability (vision, tools, reasoning)
ArrowUp, ArrowDownMove between available models, looping
EnterChoose and close
EscClose and return focus to the trigger

Accessibility

  • The search field is a combobox with aria-activedescendant; options are option elements in labelled provider groups.
  • Capability glyphs carry text for screen readers and a legend for everyone else.
  • Unavailable models stay visible with a lock and the reason, and are skipped by the arrow keys.
  • On touch the list opens without focusing search, so the keyboard does not cover it.

Motion

  • The popover's 180 ms entrance from the trigger, skipped when opened from the keyboard.
  • Highlight follows the pointer and the arrows instantly.