Model SwitcherPRO
A segmented control with a sliding pill for choosing a model or mode.
Code
1 file · 96 lines of TypeScriptPRO
Model Switcher is part of Pro
Get its source, the one-paste agent prompt and all 113 components, for a one-time $99.
Motion notes
- The pill moves with a shared layout animation, so it slides between options instead of fading.
- A snappy spring with slight bounce makes it feel physical without wobbling.
- Arrow keys move the selection, following the radiogroup pattern.
Usage
Example
<ModelSwitcher
options={[
{ value: "fast", label: "Fast" },
{ value: "thinking", label: "Thinking" },
]}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| options | { value, label, icon? }[] | — | Options to pick from. |
| value | string | — | Controlled value. |
| defaultValue | string | — | Initial value when uncontrolled. |
| onValueChange | (value: string) => void | — | Called when the selection changes. |