Docs menu

Guides


Primitives
Forms
Layout
Feedback
Overlays
Navigation
Data Display
AI

Model Picker

Choose the model a chat is sent to, from aComposer's toolbar. A compact pill<button> opens a role="listbox" in a native popover, with provider groups, descriptions, badges, logos, disabled options and typeahead.

AtlasNewDeepest reasoning, longest context
Atlas SwiftFastNear-Atlas quality at a fraction of the latency
Atlas LegacyRetired — kept for existing chats
NimbusStrong at code and tool use
Nimbus LiteFastCheapest, for quick drafts

Messages go to Atlas Swift.

Playground

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

AtlasNewDeepest reasoning, longest context
Atlas SwiftFastNear-Atlas quality at a fraction of the latency
Atlas LegacyRetired — kept for existing chats
NimbusStrong at code and tool use
Nimbus LiteFastCheapest, for quick drafts
Unstyled

Same component — Kernel look stripped. See Platforms.

placement
align
groups
descriptions
badges
icons
default value
disabled
Usage
<Composer
  actionsLeading={
    <ModelPicker
      options={[
        { value: "atlas", label: "Atlas", description: "Deepest reasoning, longest context", group: "Northwind", badges: [{ label: "New", variant: "accent" }], icon: <SparkIcon /> },
        // …
      ]}
      defaultValue="atlas"
      placement="bottom"
      onValueChange={setModel}
    />
  }
/>

Props

Props for ModelPicker.
PropTypeDefaultNotes
optionsModelPickerOption[]Required—
valuestring——
defaultValuestring——
onValueChange(value: string) => void——
namestring—Submits the value with a surrounding form, through a hidden input.
disabledbooleanfalse—
placementFloatingPlacement"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.
alignFloatingAlign"start"Cross-axis alignment. Defaults to "start".
offsetnumber8Gap between trigger and list, in pixels. Defaults to 8.
idstring——
classNameClassNameValue<ModelPickerState>—Classes for the trigger button.
listClassNameClassNameValue<ModelPickerState>—Classes for the popup list.
labelsPartial<ModelPickerLabels>—Override built-in strings (e.g. for translation); unset keys keep their English default.

Web Components

Attributes and events of the Custom Elements in @kernelui-lib/elements.
TagAttributesEvents
<kernel-model-picker>value, name, disabled, label-model, label-placeholdervaluechange

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) or { label, variant }.

Why not Select?

A native <select> is the right answer for plain options, and 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'sappearance: 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.

<Composer
  actionsLeading={<ModelPicker options={models} value={model} onValueChange={setModel} />}
  actionsTrailing={({ submit }) => <Button size="sm" variant="primary" onClick={submit}>Send</Button>}
/>

In the elements package, options come from the optionsproperty, or from light-DOM <option>s (optionally in<optgroup label>) with data-descriptionand data-badges="New:accent, Fast". It firesvaluechange 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.