Model Picker

A dropdown for choosing an AI model, built on the Select component with an accessible trigger and a placeholder. Pass an array of models and read the chosen id.

src/registry/ui/model-picker.tsx/r/model-picker.json

Installation#

bash
npx shadcn@latest add @minidev/model-picker

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/model-picker.json

Usage#

tsx
import { ModelPicker } from "@/components/ui/model-picker"

export function Example() {
  return (
    <ModelPicker
      models={[
        { id: "gpt", label: "GPT" },
        { id: "sonnet", label: "Sonnet" },
        { id: "opus", label: "Opus" },
      ]}
      value="sonnet"
    />
  )
}

API reference#

ModelPicker props
PropTypeDefault
valuestring-
defaultValuestring | nullmodels[0]?.id
onChange(v: string) => void-
modelsModel[]SAMPLE_MODELS
classNamestring-

Dependencies#

npm

React only

Built from

Examples#

All AI chat UI components for React

Learn more