Model Picker
A pill naming the current model that springs open into a glass popover. Each model has small bars for speed, quality and cost, compared with each other rather than as numbers.
Needs: None. Your own list of models and how they compare.
Customize
align
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| models | { id: string; name: string; note?: string; speed: number; quality: number; cost: number; badge?: string }[] | required | The choices. speed, quality and cost run 0 to 1 relative to each other; higher cost is more expensive. |
| value | string | – | The chosen id, or "auto". Leave it out and the picker keeps its own. |
| defaultValue | string | – | Starting choice when uncontrolled. "auto" if auto is set, else the first model. |
| onChange | (id: string) => void | – | Called with the chosen id, or "auto". |
| auto | { pick: string; reason: string } | – | Adds an Auto row that reads "Would pick Core: <reason>". pick is a model id; reason continues the sentence. |
| accent | string | "#2f6fed" | Any CSS colour for the check, the active row's meters and the focus ring. The default lightens in dark mode. |
| align | "start" | "end" | "start" | Which edge of the pill the popover lines up with. It flips upward and shifts sideways to stay inside whatever clips it. |
| label | string | "Model" | Heads the popover and names the picker for screen readers. |
| defaultOpen | boolean | false | Open on first render, without taking focus. |
| className | string | – | Added to the root element. |
| style | CSSProperties | – | Inline styles on the root; set --mlui-* variables here to theme it. |