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-pickerrsx! {
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.
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add model-pickeruse 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
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
| Prop | Type | Default | Description |
|---|---|---|---|
models | Vec<PickerModel> | Default::default() | Models (the demo set when empty). |
value | String | Default::default() | Chosen id. |
default_open | bool | true | Start with the menu open. |
thinking | bool | Default::default() | Extended thinking on at the start. |
web_search | bool | Default::default() | Web search on at the start. |
effort | String | "medium" | Starting effort: `low` · `medium` · `high`. |
marks | String | "letters" | `letters` or `brands` (coloured brand marks). |
placeholder | String | "Ask anything…" | Placeholder of the composer. |
style | String | Default::default() | `clean`, `classic`, or empty to follow `data-cstyle`. |
on_change | EventHandler<String> | — | Picked id. |
on_thinking_change | EventHandler<bool> | — | Thinking switch. |
on_web_search_change | EventHandler<bool> | — | Web search switch. |
on_effort_change | EventHandler<String> | — | Effort (`low` · `medium` · `high`). |
on_open_change | EventHandler<bool> | — | Menu opened or closed. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| EnterorSpaceor↓ | Open the menu from the trigger |
| ↑or↓ | Move through the models (the tray follows) |
| HomeorEnd | First / last model |
| Enter | Pick and close |
| Esc | Close, 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
ModelPickerMenufromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
ModelPickerMenuElinoxyn_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.