A modal-based AI model picker with provider filtering, search, starred models, and capability badges.
Installation
Usage
For provider icons, you can use svgl — a beautiful library of SVG logos for popular brands and services.
How It Works
ModelSelectoris the root context provider — pass yourproviders,models, and an optionaldefaultModel.ModelSelectorTriggerrenders a pill button showing the active model name (with shimmer animation) and its cost multiplier.ModelSelectorModalopens as a bottom sheet on mobile and a centered dialog onsm+screens.- The header contains a live search input that filters models by name and description.
- The sidebar lists provider icons for filtering by provider; clicking the active provider deselects it (shows all).
- Each model row displays the provider icon, model name, optional tag badge, description, cost, capability badges, and a star toggle.
- Starring is local state — starred models persist for the session via a
Set<string>. - Selecting a model closes the modal and updates the trigger label.
API Reference
ModelSelector
| Prop | Type | Default |
|---|---|---|
providers | Provider[] | - |
models | Model[] | - |
defaultModel? | Model | - |
children | React.ReactNode | - |
ModelSelectorTrigger
| Prop | Type | Default |
|---|---|---|
className? | string | - |
Provider
| Prop | Type | Default |
|---|---|---|
id | string | - |
icon | React.ReactNode | - |
label | string | - |
Model
| Prop | Type | Default |
|---|---|---|
id | string | - |
provider | string | - |
name | string | - |
desc | string | - |
cost | string | - |
tag | string | null | - |
caps | string[] | - |
starred | boolean | - |