Model Selector
NewModel picker for the composer: descriptions, capability badges, context size, locked models and full keyboard support.
Using Smart
Installation
$ pnpm dlx shadcn@latest add @synccn/model-selectorFirst time in this project? Connect synccn with one command.
Usage
import { ModelSelector } from "@/components/ui/model-selector";<ModelSelector models={models} value={model} onValueChange={setModel} />API reference
Generated from the component's TypeScript types, so it always matches the code.
ModelSelector
Model picker for chat composers: names, descriptions, capability badges and context size, with full keyboard support.
- modelsrequired
AIModel[]—
- value
stringControlled model id.
- defaultValue
stringModel id at first, when uncontrolled. Defaults to the first model.
- onValueChange
(id: string) => void—
- align
"start" | "end"Default
"start"Which edge of the button the menu lines up with.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Keyboard
- ↓or↑Open the menu, or move through models
- HomeorEndFirst or last model
- EnterorSpaceChoose the model
- EscClose and return focus
- TabClose the menu
Accessibility
- The menu is a listbox with aria-activedescendant; locked models are aria-disabled and skipped.
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA roles: listbox, option
- ARIA attributes: aria-activedescendant, aria-controls, aria-disabled, aria-expanded, aria-haspopup, aria-label, aria-selected
- Keys handled: ArrowUp, ArrowDown, Home, End, Enter, Tab, Space
- Closes with Escape
- Closes when you click or tap outside
- Flips to whichever side has room, so it stays on screen