Skip to content
IndexRequest a UIAboutContact

Response Version Switcher

An AI answer with a 1/3 switcher so people can regenerate and flip between versions without losing earlier ones.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Clean chat UI mockup of an AI assistant reply to the question Give me a tagline for a coffee shop, below the answer a small control bar with a left arrow, the text 2 / 3, a right arrow, a Regenerate button with a circular arrow icon and thumbs up and down icons, the answer text slightly different in three states, light theme, flat modern style, comfortable spacing. Negative: robots, heavy shadows, gradients, text errors, clutter. Reduced motion: static mockup.

About this pattern

Definition

When an AI answer misses, people regenerate it. If each regeneration replaces the old one, the best version can be lost. A version switcher keeps every answer, shows which one is on screen, and lets people move back and forth and keep the one they like.

Purpose & UX principles

  • Show the position as 2 of 3 with previous and next arrows.
  • Keep earlier versions; regenerating adds a new one at the end.
  • Announce the change to screen readers and keep keyboard access to the arrows.
  • Let people copy or continue from whichever version is showing.

Interaction states

  • Regenerate, previous and next buttons, and a version counter.

Motion specification

  • A new version takes about 600ms to appear with a dots indicator.
  • Reduced motion: the answer appears at once.

Responsive behaviour

  • Cap the number of versions, such as five, and say so.
  • Do not hide that a new version is being generated; show a loading state.

Code

HTML
<div class="bx"><div class="q">Give me a tagline for a coffee shop.</div><div class="a" id="an" aria-live="polite"></div><div class="bar"><button class="ic" id="pv" type="button" aria-label="Previous version">‹</button><span id="ct">1 / 1</span><button class="ic" id="nx" type="button" aria-label="Next version">›</button><button class="mini" id="rg" type="button">Regenerate</button></div><p class="out" id="out" role="status"></p></div>

Related patterns

AI Response Actions

↗
AI Response ActionsAI & Conversational

Streaming Chat Response

↗
Streaming Chat ResponseAI & Conversational

AI Suggestion Diff

↗
AI Suggestion DiffAI & Conversational