Skip to content
Back

Model Picker

The model menu of an AI chat – point at a model and its speed, quality and cost dashes fill, switch on extended thinking and its effort unfolds, while the tray rolls the first-token time and price.

oxyn add model-picker
MCP
Dioxus
rsx! {
    ModelPickerMenu {
        models: models,
        on_change: move |id| model.set(id),
        on_effort_change: move |e| effort.set(e),
    }
}

Rendered from Rust at build time · goes live when visible

When to use

  • The model menu of an AI chat: compare speed, quality and cost at a glance, switch on extended thinking and pick its effort, and see what the pointed model costs before choosing it.

When not to use

  • Prompt composer with model picker, voice input, app connections and approval request: use Chat Composer instead.
  • The prompt box for an agent, in six layouts: use Composer instead.
  • Send, stop, queue and steer in one control, in twelve styles: use Send control instead.

Installation

Model Picker is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.

Terminal
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add model-picker
Rust
use crate::oxyn::{ModelPickerMenu, STATUS_INDICATOR_CSS};

Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{ModelPickerMenu, STATUS_INDICATOR_CSS};

Usage

Dioxus · rust
rsx! {
    ModelPickerMenu {
        models: models,
        on_change: move |id| model.set(id),
        on_effort_change: move |e| effort.set(e),
    }
}

Examples

Default

Clean: point at a model and its dashes fill blue while the tray rolls its first-token time and price.

Code
rsx! {
    ModelPickerMenu {
        models: models,
        on_change: move |id| model.set(id),
        on_effort_change: move |e| effort.set(e),
    }
}

Thinking

Extended thinking on: the Low / Medium / High effort unfolds and the time multiplies.

Code
rsx! {
    ModelPickerMenu {
        models: models,
        thinking: true,
        on_change: move |id| model.set(id),
        on_effort_change: move |e| effort.set(e),
    }
}

Web search

Web search on: the tray says it looks things up.

Code
rsx! {
    ModelPickerMenu {
        models: models,
        on_change: move |id| model.set(id),
        on_effort_change: move |e| effort.set(e),
    }
}

Classic

Classic style: title-case headers, monochrome dot-dashes, a round send and the tray on its own shelf.

Code
rsx! {
    ModelPickerMenu {
        models: models,
        on_change: move |id| model.set(id),
        on_effort_change: move |e| effort.set(e),
    }
}

Brand marks

Oxyn extra: coloured brand marks on the rows and the trigger instead of letter tiles.

Code
rsx! {
    ModelPickerMenu {
        models: models,
        marks: "brands".into(),
        on_change: move |id| model.set(id),
        on_effort_change: move |e| effort.set(e),
    }
}

Closed

Closed: the trigger pill with the model, a blue bulb when thinking is on, and the chevron.

Code
rsx! {
    ModelPickerMenu {
        models: models,
        thinking: true,
        on_change: move |id| model.set(id),
        on_effort_change: move |e| effort.set(e),
    }
}

Oxyn model menu

Extended: the compact model menu whose stats unfold under the pointed row.

Code
rsx! {
    ModelMenu {
        models: models,
        value: "sonnet",
        on_change: move |id| model.set(id),
    }
}

API reference

ModelPickerMenu

PropTypeDefaultDescription
modelsVec<PickerModel>Default::default()Models (the demo set when empty).
valueStringDefault::default()Chosen id.
default_openbooltrueStart with the menu open.
thinkingboolDefault::default()Extended thinking on at the start.
web_searchboolDefault::default()Web search on at the start.
effortString"medium"Starting effort: `low` · `medium` · `high`.
marksString"letters"`letters` or `brands` (coloured brand marks).
placeholderString"Ask anything…"Placeholder of the composer.
styleStringDefault::default()`clean`, `classic`, or empty to follow `data-cstyle`.
on_changeEventHandler<String>—Picked id.
on_thinking_changeEventHandler<bool>—Thinking switch.
on_web_search_changeEventHandler<bool>—Web search switch.
on_effort_changeEventHandler<String>—Effort (`low` · `medium` · `high`).
on_open_changeEventHandler<bool>—Menu opened or closed.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EnterorSpaceor↓Open the menu from the trigger
↑or↓Move through the models (the tray follows)
HomeorEndFirst / last model
EnterPick and close
EscClose, focus back on the trigger

Accessibility

  • The menu is a dialog "Model settings" holding a listbox with aria-activedescendant; each option names its speed, quality and cost ("Speed 2, quality 5, cost 5 of 5").
  • Extended thinking and Web search are switches; Effort is a radiogroup that is only tabbable while thinking is on.
  • The trigger's name follows the settings ("Model: Sonnet 5.5, extended thinking"); the tray is a polite live region.

Responsive behaviour

  • The composer is 362 px and the menu 320 px; under 340 px the descriptions drop and rows shrink to 40 px.
Edge cases (spec)

Composer 362 px, menu 320 px (never wider than the composer); under 340 px descriptions drop and rows are 40 px.

Notes for AI

  • Import ModelPickerMenu from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: ModelPickerMenuEl in oxyn_gpui.
  • It reads a clock (now) for live timers; pass one clock for the whole page rather than one per component.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI