Skip to content
IndexRequest a UIAboutContact

AI Response Actions

Copy, thumbs up and down with follow-up reasons, and Regenerate under an AI answer.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Design the action bar under an AI chat answer. Answer text: "Use a 12-column grid with 24 pixel gutters on desktop." Below it, four icon buttons with tooltips and aria-labels: Copy, Good response, Bad response, Regenerate. Copy copies the text and swaps its icon to a check for 1.5 seconds. Good and Bad toggle (aria-pressed) and are mutually exclusive; choosing Bad reveals chips "Inaccurate", "Too long", "Not helpful" and choosing a chip replaces them with "Thanks for the feedback". Regenerate shows a shimmering placeholder for about a second and then a different answer. Light minimal style, 32 pixel round icon buttons, subtle hover, prefers-reduced-motion fallback. Plain HTML, CSS and JavaScript with inline SVG icons.

About this pattern

Definition

Response actions are the small toolbar beneath an AI answer. They let people copy it, rate it and ask for another version, and they feed quality signals back to the product.

Purpose & UX principles

  • Copy, Good, Bad and Regenerate cover the four things people do most after reading an answer.
  • A thumbs-down should ask a one-tap reason (Inaccurate, Too long, Not helpful) without blocking the conversation.
  • Confirm every action quietly (checkmark, "Thanks") and keep icon buttons labelled for assistive tech.

Interaction states

  • Default, copied (checkmark 1.5s), thumbs pressed (only one at a time), reasons shown after thumbs-down, thanks, regenerating (shimmer) and new answer.

Motion specification

  • Copy checkmark pops in 150ms; reasons slide down 160ms; regenerate shows a shimmer for 900ms then fades in the new text.
  • Reduced motion: no shimmer or slide, only the text swap.

Responsive behaviour

  • Icon buttons are at least 32px square with 4px gaps; labels appear on hover or focus.
  • On phones show the toolbar permanently, not on hover.

Code

HTML
<div class="bx"><div class="ans" id="ans">Use a 12-column grid with 24 pixel gutters on desktop.</div><div class="bar" role="toolbar" aria-label="Response actions"><button id="cp" type="button" aria-label="Copy" title="Copy">⧉</button><button id="up" type="button" aria-label="Good response" aria-pressed="false" title="Good response">👍</button><button id="dn" type="button" aria-label="Bad response" aria-pressed="false" title="Bad response">👎</button><button id="rg" type="button" aria-label="Regenerate" title="Regenerate">↻</button></div><div class="rs" id="rs" hidden><span>What went wrong?</span><button type="button">Inaccurate</button><button type="button">Too long</button><button type="button">Not helpful</button></div><p class="th" id="th" aria-live="polite"></p></div>

Related patterns

Streaming Chat Response

↗
Streaming Chat ResponseAI & Conversational

Copy Feedback Button

↗
Copy Feedback ButtonMicro Interactions

Reaction Picker

↗
Reaction PickerMicro Interactions