Xzero UI
Pro library

Model pickerPro

A model picker in one quiet pill: open it to choose from featured models with a one line note each, set the reasoning effort, or browse every other model by provider, and the pill swaps to your choice in place.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/model-picker
Live · keyboard ready

Drop it into a composer or settings row. Pass models, value and onChange to control the selection, and effort with onEffortChange for reasoning models; with no props it shows a sample lineup of current models.

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/model-picker

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { ModelPicker } from "@/components/xzero/blocks/model-picker/model-picker";

export function ComposerModel({ model, setModel, effort, setEffort }) {
  return (
    <ModelPicker
      value={model}
      onValueChange={id => setModel(id)}
      effort={effort}
      onEffortChange={setEffort}
      featured={["claude-opus-5-5", "claude-sonnet-5-5", "claude-haiku-5-5"]}
      showSummary={false}
    />
  );
}

API reference

ModelPicker

A model picker for an AI product. One quiet pill names the current model and its effort and opens a short menu: the featured models with a one line description each, an Effort submenu for reasoning models and every other model under More models, grouped by provider. Choosing a model closes the menu, the pill morphs to the new model, and the review underneath updates its description, context window, prices and effort. On phones the submenus open as pages inside the menu with a Back row.

PropTypeDefaultDescription
modelsPickerModel[]sampleModelsThe catalog. Each model has id (the API id the picker reports), name, provider, blurb (the short menu line), description, context, maxOutput, price { input, output } in USD per 1M tokens, released, and optional tag, effort { levels, default }, mark and color. Anthropic prices in the sample are real; every other price and limit is a sample value.
providersPickerProvider[]sampleProvidersProviders in the order More models groups them, each { id, name, mark, color? }. A model without its own mark uses its provider's.
featuredstring[]["claude-opus-5-5", "claude-sonnet-5-5", "gpt-6.1-sol", "gemini-4-argon"]Model ids listed at the top of the menu, in order. Every other model sits under More models. With your own models and no featured list, the first four are featured.
valuestring–The chosen model id (controlled).
defaultValuestring–The first chosen model when uncontrolled. Defaults to the first featured model.
onValueChange(id: string, model: PickerModel) => void–Called when someone picks a model.
effort"low" | "medium" | "high" | "xhigh" | "max"–Effort for the chosen model (controlled). A level the model does not accept snaps to the nearest level it does.
defaultEffortEffort–The first effort when uncontrolled. Defaults to the chosen model's own default.
onEffortChange(effort: Effort) => void–Called when the effort changes, including when a new model snaps it to a level it accepts.
openboolean–Whether the menu is open (controlled).
defaultOpenbooleanfalseOpens the menu on first render.
onOpenChange(open: boolean) => void–Called when the menu opens or closes.
showSummarybooleantrueShows the review under the pill: description, context, input and output price, effort, and a short confirmation after each change. Turn it off to use the pill alone, for example inside a composer toolbar.
classNamestring–Class on the root element.

Keyboard interactions

KeysAction
Enter, Space, Arrow downOn the pill, opens the menu and focuses the current model.
Arrow up / Arrow downMoves through the models and rows. The highlight follows.
Type a letterJumps to the next model whose name starts with it.
Enter, SpaceChooses the highlighted model or effort and closes the menu.
Arrow right / Arrow leftOpens and closes the Effort and More models submenus, or their pages on phones.
EscapeCloses the menu and returns focus to the pill.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Guidance for AI tools

Blocks are complete, self-contained screens with sample data. Replace the sample data and connect the callbacks described above. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components