Skip to content
Agent UI
Pickers & navigationModelPicker

Model Picker

Searchable model dropdown with keyboard navigation and provider hints.

ModelPicker ships with a full API table, a copyable example, and accessibility notes.

tsx

Installation

Install the package once, then import ModelPicker from its direct entry point or from the root.

bash
pnpm add @agent-ui/react
tsx
import { ModelPicker } from "@agent-ui/react/model-picker";

Tailwind CSS v4 users: add @source "../node_modules/@agent-ui/react/src" to the global stylesheet so the library utilities are generated.

Usage

The example below is the same code that renders the preview. Copy it, swap in your own handlers, and ship.

tsx
import { ModelPicker } from "@agent-ui/react";
 
<ModelPicker
models={models}
selectedId={model}
onChange={(m) => setModel(m.id)}
/>

API reference

Every prop ModelPicker accepts, its type, default, and behaviour.

API reference for this component
NameTypeDefaultDescription
modelsModelOption[]—Options with id, name, and provider.
selectedIdstring—Controlled selection.
onChange(model: ModelOption) => void—Selection callback.
placeholderstring"Select model"Trigger copy.
disabledbooleanfalseDisables the trigger.
classNamestring—Inherits every native div attribute, including id, aria-*, data-*, onClick, and style.

Accessibility

Combobox semantics, arrow-key navigation, Escape to close, and type-ahead filtering.
Use it with the rest of the library

ModelPicker composes with MessageList, ChatShell, useChat, and the provider compose blocks. Browse the full reference or see all components in the gallery.

7 lines · copy-ready