• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
drewmcdonald

drewmcdonald

promptCompare

Public
Like
promptCompare
Home
Code
11
.claude
3
.playwright-mcp
1
backend
3
docs
5
frontend
4
shared
1
.gitignore
.mcp.json
.vtignore
CLAUDE.md
deno.json
Environment variables
2
Branches
1
Pull requests
Remixes
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
.claude
/
skills
/
ai-elements
/
references
/
model-selector.md
Code
/
.claude
/
skills
/
ai-elements
/
references
/
model-selector.md
Search
…
Viewing readonly version of main branch: v172
View latest version
model-selector.md

Model Selector

A searchable command palette for selecting AI models in your chat interface.

The ModelSelector component provides a searchable command palette interface for selecting AI models. It's built on top of the cmdk library and provides a keyboard-navigable interface with search functionality.

See scripts/model-selector.tsx for this example.

Installation

npx ai-elements@latest add model-selector

Features

  • Searchable interface with keyboard navigation
  • Fuzzy search filtering across model names
  • Grouped model organization by provider
  • Keyboard shortcuts support
  • Empty state handling
  • Customizable styling with Tailwind CSS
  • Built on cmdk for excellent accessibility
  • TypeScript support with proper type definitions

Props

<ModelSelector />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof Dialog>-Any other props are spread to the underlying Dialog component.

<ModelSelectorTrigger />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof DialogTrigger>-Any other props are spread to the underlying DialogTrigger component.

<ModelSelectorContent />

PropTypeDefaultDescription
titleReactNode-Accessible title for the dialog (rendered in sr-only).
...propsReact.ComponentProps<typeof DialogContent>-Any other props are spread to the underlying DialogContent component.

<ModelSelectorDialog />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CommandDialog>-Any other props are spread to the underlying CommandDialog component.

<ModelSelectorInput />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CommandInput>-Any other props are spread to the underlying CommandInput component.

<ModelSelectorList />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CommandList>-Any other props are spread to the underlying CommandList component.

<ModelSelectorEmpty />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CommandEmpty>-Any other props are spread to the underlying CommandEmpty component.

<ModelSelectorGroup />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CommandGroup>-Any other props are spread to the underlying CommandGroup component.

<ModelSelectorItem />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CommandItem>-Any other props are spread to the underlying CommandItem component.

<ModelSelectorShortcut />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CommandShortcut>-Any other props are spread to the underlying CommandShortcut component.

<ModelSelectorSeparator />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CommandSeparator>-Any other props are spread to the underlying CommandSeparator component.

<ModelSelectorLogo />

PropTypeDefaultDescription
providerstringRequiredThe AI provider name. Supports major providers like
...propsOmit<React.ComponentProps<-Any other props are spread to the underlying img element (except src and alt which are generated).

<ModelSelectorLogoGroup />

PropTypeDefaultDescription
...propsReact.ComponentProps<-Any other props are spread to the underlying div element.

<ModelSelectorName />

PropTypeDefaultDescription
...propsReact.ComponentProps<-Any other props are spread to the underlying span element.
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.