Retry with modelPro
The retry action with a choice: a new seed from the same model, or another model. Every version is kept and labelled with the model that wrote it.
On this page
Installation
Usage
import { ResponseVersions, RetryWithModel, useResponseVersions } from "@/components/ui/chatcn/pro/retry-with-model"
const v = useResponseVersions([{ id: "v1", model: "Claude Sonnet 5.5", value: text }])
<MessageActions>
<MessageActionCopy value={text} />
<RetryWithModel models={models} current="claude-sonnet-5-5" onRetry={regenerate} />
</MessageActions>
<ResponseVersions versions={v.versions} index={v.index} onIndexChange={v.setIndex} />RetryWithModel sits in MessageActions at the toolbar's size and tone and opens a menu: Same model, new seed first, naming the model on screen so a retry never switches models by surprise, then every model with a short note and a check on the current one. onRetry receives the model and whether it was a seed or a model change. ResponseVersions is the free BranchNavigator plus a quiet label for the version on screen: the model, new seed when it was one, and a shimmering Writing with while it generates. The label changes in place, so switching never moves the toolbar. useResponseVersions keeps the list: add appends a pending version and shows it, settle fills it in, fail drops it and goes back.
Examples
States
Props
| Prop | Type | Notes |
|---|---|---|
models | RetryModel[] | { id, name, note?, disabled? } |
current | string | Id of the model behind the version on screen |
onRetry | ({ model, mode: "seed" | "model" }) => void | |
disabled | boolean | Also off while the message streams |
align | "start" | "center" | "end" | Menu alignment. Default start |
labels | Partial<RetryWithModelLabels> | Every string, for translation |
ResponseVersions.versions | ResponseVersion[] | { id, model, seed?, pending? } |
ResponseVersions.index, onIndexChange | number | 0 based |
Keyboard
| Key | Action |
|---|---|
| Enter or Space | Open the retry menu |
| Up and Down | Move through the menu |
| Left and Right on the switcher | Previous and next version |
Accessibility
- The trigger is named Retry response; the current model is read as Current in the menu.
- The switcher is a group named
Version 2 of 3; the model label is a polite live region.
Motion
The menu grows from its trigger in 180 ms and opens without animation from the keyboard. The version label swaps with the kit's 150 ms swap (fade, slight scale, 2 px blur), opacity only under reduced motion.