# Model Picker

Choose the model a chat is sent to, from a [Composer](/components/composer/) 's toolbar. A compact pill `<button>` opens a `role="listbox"` in a native popover, with provider groups, descriptions, badges, logos, disabled options and typeahead.

## Playground

Toggle every adjustable prop and watch the component — and the code — update live.

## Props

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `options` | `ModelPickerOption[]` | Required | — |
| `value` | `string` | — | — |
| `defaultValue` | `string` | — | — |
| `onValueChange` | `(value: string) => void` | — | — |
| `name` | `string` | — | Submits the value with a surrounding form, through a hidden input. |
| `disabled` | `boolean` | `false` | — |
| `placement` | `FloatingPlacement` | `"top"` | Which side of the trigger the list opens on. Defaults to `"top"`, since a composer sits at the bottom of the screen; it flips when there's no room. |
| `align` | `FloatingAlign` | `"start"` | Cross-axis alignment. Defaults to `"start"`. |
| `offset` | `number` | `8` | Gap between trigger and list, in pixels. Defaults to `8`. |
| `id` | `string` | — | — |
| `className` | `ClassNameValue<ModelPickerState>` | — | Classes for the trigger button. |
| `listClassName` | `ClassNameValue<ModelPickerState>` | — | Classes for the popup list. |
| `labels` | `Partial<ModelPickerLabels>` | — | Override built-in strings (e.g. for translation); unset keys keep their English default. |

### Web Components

| Tag | Attributes | Events |
| --- | --- | --- |
| `<kernel-model-picker>` | `value`, `name`, `disabled`, `label-model`, `label-placeholder` | `valuechange` |

Each option is `{ value, label, description?, group?, badges?, icon?, disabled? }`. Consecutive options with the same `group` are listed under one heading. A badge is a string (a neutral [Badge](/components/badge/)) or `{ label, variant }`.

## Why not Select?

A native `<select>` is the right answer for plain options, and [Select](/components/select/) is one. A model list isn't plain: each option carries a description, badges and a logo, and `<option>` can only hold text outside Chromium's `appearance: base-select`. So the picker keeps what the platform does give — the popover's top layer, light dismiss, Escape and focus return to the trigger — and adds the WAI-ARIA listbox pattern by hand.

## In a composer

The trigger is sized to `--kernel-control-height-sm`, level with a small send button, and drawn with Kernel's optical pill recipe: the radius stops at a true half-height pill, the text clears the end caps, and the logo and chevron sit concentric with them at every radius setting. It opens upward by default, since a composer sits at the bottom of the screen, and flips when there's no room.

In the elements package, options come from the `options` property, or from light-DOM `<option>` s (optionally in `<optgroup label>`) with `data-description` and `data-badges="New:accent, Fast"`. It fires `valuechange` with `detail.value`.

## Keyboard

- `Enter`, `Space`, `↓` or `↑` on the trigger opens the list on the current model.
- `↓` / `↑` move through enabled options; `Home` / `End` jump to the ends.
- `Enter` or `Space` selects and returns focus to the trigger; `Escape` closes without changing it; `Tab` closes and moves on.
- Typing jumps to a model by name — on the open list or the closed trigger. Repeating one letter cycles through the models that start with it.

## Accessibility

- The trigger reads "Model, Atlas Swift" — the model name, with a visually hidden prefix (`labels.model`) saying what it is.
- Focus moves to the list and `aria-activedescendant` tracks the active option, so a screen reader announces each option as you arrow.
- Groups are `role="group"` labelled by their heading, so crossing into a provider announces it.
- Disabled options stay listed and announced as unavailable (`aria-disabled`), and are skipped by the arrows and typeahead.
- Logos are decorative; the name already says which model it is.
