Model Picker, animated React component
A model picker for AI products in one quiet pill. Open it for featured models with a one-line note each, an Effort submenu for models that reason, and More models grouped by provider. Choosing closes the menu, the pill springs to the new name's width, and a summary of context, prices and effort crossfades underneath. Effort snaps to the nearest level the new model accepts. Submenus become pages on phones, and it is fully keyboard operable: arrows, Right for a submenu, Enter to choose, Escape to close, and a letter to jump.
- Pro
- AI Components
- Hover
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| models | PickerModel[] | — | The catalog: id, name, provider, blurb, description, context, price?, effort?. The default is a sample with placeholder prices. |
| providers | PickerProvider[] | — | Providers in the order More models groups them, each with a colour and a small glyph. |
| featured | string[] | — | Model ids at the top of the menu. The rest go under More models. |
| value / defaultValue | string | — | The chosen model id, controlled or not. |
| onValueChange | (id, model) => void | — | Called when someone picks a model. |
| effort / onEffortChange | "low" | "medium" | "high" | "max" | — | Effort, controlled or not. Snaps to a level the model accepts. |
| defaultOpen | boolean | false | Opens the menu on first render. |
| showSummary | boolean | true | The description, context, prices and effort under the pill. |
| footnote | string | — | Line under the summary. Say here when prices are samples. |
| className | string | — | Classes for the wrapper. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry with your API key
Model Picker is a Pro item, so the CLI has to send your API key. Do this once per project:
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
nxs_and is shown only once. - In your project root, next to
package.json, create a file named.env.localwith this line, using your own key:NEXUS_API_KEY=nxs_your_key_here
- Open
components.jsonand add this entry inside the outermost braces, next to"aliases". Leave{name}and${NEXUS_API_KEY}exactly as written; the CLI fills them in:"registries": { "@nexus-labs": { "url": "https://www.nexus-ui.com/api/registry/{name}", "headers": { "Authorization": "Bearer ${NEXUS_API_KEY}" } } }
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
How Model Picker works
A model picker for an AI product in one quiet pill. It opens a menu of featured models with a one line note each, an Effort submenu for models that reason, and More models grouped by provider. Choosing closes the menu, the pill springs to the new name's width, and the summary underneath crossfades to the new model. On phones the submenus open as pages inside the menu with a Back row.
The source, the install command and the build prompt come with Pro.