# ModelSelector

A compact model picker: each model with its description, and a check on the current one.

- **Use it for**: Picking the model for the next request.
- **Not for**: Settings beyond the model. Try [ModelControls](https://unseenui.com/components/model-controls/).

## Good to know

- The search field shows only for more than seven models; pass `searchable` to choose.
- Provider headings show only when the models come from more than one provider.
- The current model has a check, not a radio circle; arrow keys still move between models.

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { ModelSelector } from '@stackunseen/ui/assistant';
import '@stackunseen/ui/styles.css';

<ModelSelector models={models} value={model} onValueChange={setModel} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `className` | `string` |  |
| `disabled` | `boolean` |  |
| `label` | `string` |  |
| `labels` | `Partial<ModelSelectorLabels>` | Replaces the built-in wording, for example to translate it. |
| `models` (required) | `readonly ModelOption[]` |  |
| `onValueChange` (required) | `(id: string) => void` |  |
| `searchable` | `boolean` | Shows a search field. |
| `value` (required) | `string` |  |
| `variant` | `"outline" \| "ghost"` | `ghost` reads as quiet text, for a composer toolbar. |

## Keyboard

Enter opens the list; arrow keys move between models; Escape closes.

## Works with

[Chat](https://unseenui.com/components/chat/), [PromptInput](https://unseenui.com/components/prompt-input/), [Message](https://unseenui.com/components/message/), [StreamingResponse](https://unseenui.com/components/streaming-response/), [MessageActions](https://unseenui.com/components/message-actions/), [Suggestions](https://unseenui.com/components/suggestions/), [Attachment](https://unseenui.com/components/attachment/), [AttachmentTray](https://unseenui.com/components/attachment-tray/), [FileDropzone](https://unseenui.com/components/file-dropzone/), [FeedbackCapture](https://unseenui.com/components/feedback-capture/), [ModelControls](https://unseenui.com/components/model-controls/)

Page: https://unseenui.com/components/model-selector/
